Can't write geotag data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyexiv2 |
Fix Released
|
High
|
Olivier Tilloy | ||
Bug Description
Immediately after setting a list of Rationals to Exif.GPSInfo.
Code to demonstrate this bug:
---
import pyexiv2
import sys
import sets
print '''First, we'll read in the image of some graffiti in Chile.'''
image = pyexiv2.
image.readMetad
defined_keys = sets.Set(
gps_keys = sets.Set(
if (defined_
print '''Hmmm... looks like there's already GPS data in the image.''' +\
''' That kinda invalidates this demo. Oh well.'''
sys.exit()
latitude_list = [
pyexiv2.
pyexiv2.
pyexiv2.
longitude_list = [
pyexiv2.
pyexiv2.
pyexiv2.
print u'''This photo was taken at %s\xb0 %s' %s" S, %s\xb0 %s' %s" W.''' % (
print '''So now we assign that and other info to the image...'''
image['
image['
image['
image['
image['
image['
print '''... but the values for latitude and longitude weren't assigned''' +\
''' properly! They're %s and %s! Huh?!''' % (
#image.
---
Output from running this code:
---
eddie:~/tmp$ python possiblebugdemo.py
First, we'll read in the image of some graffiti in Chile.
This photo was taken at 33/1° 2/1' 512196/10000" S, 71/1° 37/1' 361920/10000" W.
So now we assign that and other info to the image...
... but the values for latitude and longitude weren't assigned properly! They're 0/1 and 0/1! Huh?!
---
Sample photo attached.
Related branches
Changed in pyexiv2: | |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in pyexiv2: | |
assignee: | nobody → Olivier Tilloy (osomon) |
status: | Confirmed → In Progress |
Changed in pyexiv2: | |
status: | Fix Committed → Fix Released |
I haven't had any trouble with this. I've geotagged at least 1000 photos with this script:
http:// clanmills/ articles/ gpsexiftags/ gps_py. shtml
I'm using #import surd to deal with Rational numbers and I have some one-line functions to encode the lat/long as a tuple of rational numbers. I can see you are doing something similar - however there must be a significant difference.
I've been using this on pyexiv2.0.1.2 on exiv2 0.16 and more recently with 0.1.3 and exiv2 0.18 (on Mac, Windows and Linux) and haven't noticed any problems with it.