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

location_dump doesnt not work sometimes #3

Closed
spacemishka opened this issue Jul 12, 2016 · 2 comments
Closed

location_dump doesnt not work sometimes #3

spacemishka opened this issue Jul 12, 2016 · 2 comments

Comments

@spacemishka
Copy link

spacemishka commented Jul 12, 2016

Hello,

at first thanks for this library!!!

But i have little problem with some images. I wrote a script to add EXIF-Tags with GPS to Images which don't have any. This works ok as far i can see

part of script:

        img = Image.open(os.path.join('pictures', filename))
        exf = img._getexif()
        exf[0]['GPSLatitude'] = lpi[2]
        exf[0]['GPSLongitude'] = lpi[1]
        exf[0]['GPSAltitude'] = 0.00
        exf[1]['GPSLatitude'] = lpi[2]
        exf[1]['GPSLongitude'] = lpi[1]
        exf[1]['GPSAltitude'] = 0.00
        img.save(os.path.join('tagged', 'tagged_' + filename), ifd=exf)

but jpg.exif.dump_location doesnt create images of location. For any photo taken with my Iphone which adds GPS-Tags automatically it works.

What did i miss??

Thanks
Peter

@Moustikitos
Copy link
Owner

Hello Peter,

  1. make sure you use Tyf.Image class
  2. you have to initiate "GPSLatitudeRef" and "GPSLongitudeRef" tags

exf[0]['GPSLatitude'] = exf[0]['GPSLatitudeRef'] = lpi[2]
exf[0]['GPSLongitude'] = exf[0]['GPSLongitudeRef'] = lpi[2]
exf[0]['GPSAltitude'] = 0.00

No need to do it with exf[1] that is JPEG thumbnail actually

thanks for using my lib

@spacemishka
Copy link
Author

thanks! Now it's working:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants