Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds user location request to upload GPS coords #5

Open
frgfm opened this issue Jan 9, 2022 · 3 comments
Open

Adds user location request to upload GPS coords #5

frgfm opened this issue Jan 9, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@frgfm
Copy link
Member

frgfm commented Jan 9, 2022

It would be much more accurate to request access to the user location upon uploading to get the most accurate information about the location where the picture was taken.

@frgfm frgfm added enhancement New feature or request help wanted Extra attention is needed labels Jan 9, 2022
@frgfm
Copy link
Member Author

frgfm commented Jan 9, 2022

That might be interesting: https://medium.com/spatial-data-science/build-a-useful-web-application-in-python-geolocating-photos-186122de1968

from exif import Image

img = Image("path/to/img.jpg")
if img.has_exif:
    cam_maker = img.lens_make
    cam_model = img.lens_model
    cam_specs = img.lens_specification
    pic_ts = img.datetime
    pic_ts_offset = img.offset_time

@frgfm frgfm self-assigned this Jan 9, 2022
@frgfm
Copy link
Member Author

frgfm commented Jun 18, 2022

@frgfm
Copy link
Member Author

frgfm commented Jun 18, 2022

Using metadata with PIL 9:

from PIL.ExifTags import TAGS
from PIL import Image

img = Image.open('IMG_1135.JPG')

meta = img.getexif()

for tag_id in meta:
    print(TAGS.get(tag_id), meta.get(tag_id).decode() if isinstance(meta.get(tag_id), bytes) else meta.get(tag_id))
ResolutionUnit 2
ExifOffset 250
Make Apple
Model iPhone SE (1st generation)
Software 15.0
Orientation 6
DateTime 2022:06:18 13:50:29
YCbCrPositioning 1
XResolution 72.0
YResolution 72.0
HostComputer iPhone SE (1st generation)

with PIL 7 (cf. https://stackoverflow.com/questions/69711902/i-cant-get-all-metadata-tags-in-python-with-pillow):

ExifVersion 0232
ComponentsConfiguration 
ShutterSpeedValue (17407, 1946)
DateTimeOriginal 2022:06:18 13:50:29
DateTimeDigitized 2022:06:18 13:50:29
ApertureValue (185611, 81587)
BrightnessValue (87281, 10636)
ExposureBiasValue (0, 1)
MeteringMode 5
Flash 16
FocalLength (83, 20)
ColorSpace 1
ExifImageWidth 4032
FocalLengthIn35mmFilm 29
SceneCaptureType 0
Make Apple
None +02:00
None +02:00
None +02:00
SubsecTimeOriginal 089
SubjectLocation (2015, 1511, 2217, 1330)
SubsecTimeDigitized 089
ExifImageHeight 3024
SensingMethod 2
Model iPhone SE (1st generation)
Orientation 6
ExposureTime (1, 493)
XResolution (72, 1)
YCbCrPositioning 1
FNumber (11, 5)
SceneType 
YResolution (72, 1)
ExposureProgram 2
CustomRendered 3
ISOSpeedRatings 25
ResolutionUnit 2
ExposureMode 0
FlashPixVersion 0100
WhiteBalance 0
Software 15.0
LensSpecification ((2175733, 524273), (2175733, 524273), (11, 5), (11, 5))
LensMake Apple
LensModel iPhone SE (1st generation) back camera 4.15mm f/2.2
DateTime 2022:06:18 13:50:29
HostComputer iPhone SE (1st generation)
ExifOffset 250

@frgfm frgfm added this to the 1.0.0 milestone Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant