LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
197 stars 39 forks source link

Writing GPS EXIF gives TypeError #86

Closed jparkinson97 closed 2 years ago

jparkinson97 commented 2 years ago

Hi thanks for creating pyexiv2.

I am trying to write GPS metadata to an image using the following following script:

 output_metadata = pyexiv2.ImageMetadata('mnt/c/Users/User/OneDrive/Desktop/Tiles/output/output0.tif')
output_metadata.read()

tiepoint = 0.0, 0.0, 0.0, 310259.9162, 5842767.3431, 0.0
output_metadata['Exif.Image.0x8482'] = pyexiv2.ExifTag('Exif.Image.0x8482', tiepoint)
output_metadata.write()

But I receive the error message:

TypeError: sequence item 0: expected str instance, float found

I have already tried formatting the data as a string, but this leads to quote marks being placed round the values when the metadata is subsequently read.

I have also tried using the Exif.GPSInfo.GPSLatitudeRef key given in the documentation, but this does not allow the location data to be stored with enough accuracy.

Is there any way round this issue?

LeoHsiao1 commented 2 years ago

Hi! You're probably using another project py3exiv2.

jparkinson97 commented 2 years ago

Sorry about that. Ill close the issue.