

This grew out of a need to add GPS tagged data to my images, Unfortunately the other libraries out there couldn't do updates and didn't seem easily architectured to be able to add such a thing. pexif is a Python library for parsing and more importantly editing EXIF data in JPEG files.
#ADDING GPS DATA TO JALBUM IMAGE CODE#
The above code works, but I had to modify the set_gps_location function to work with the current version of pyexiv2. pexif was written with geotags as a goal (my emphasis).

Set_gps_location(sys.argv, float(sys.argv), float(sys.argv)) # convert decimal coordinates into degrees, munutes and secondsĮxiv_lat = (pyexiv2.Rational(lat_deg*60+lat_deg,60),pyexiv2.Rational(lat_deg*100,6000), pyexiv2.Rational(0, 1))Įxiv_lng = (pyexiv2.Rational(lng_deg*60+lng_deg,60),pyexiv2.Rational(lng_deg*100,6000), pyexiv2.Rational(0, 1))Įxiv_image = exiv_latĮxiv_image = lat_degĮxiv_image = exiv_lngĮxiv_image = lng_degĮxiv_image = "WGS-84"Įxiv_image = '2 0 0 0' I will take you step by step through the process of transferring the GPS information from a smartphone photo to a photo from another camera like a DSLR. I've tested this script by uploading geotagged image to Panoramio #!/usr/bin/env pythonĭef set_gps_location(file_name, lat, lng): The EditPhotoInfo program fetches the GPS information from the original JPEG images in the jAlbum image directory and it has more functions like the geotagging. If you know the GPS coordinates for a location from another source (like your smart phone, or from coordinates on a map), you can add the GPS information to a photo with Adobe Bridge.
#ADDING GPS DATA TO JALBUM IMAGE HOW TO#
Here is an example how to set GPS position using pyexiv2 library.
