ExifTool Forum

ExifTool => Developers => Topic started by: search on June 08, 2021, 09:59:39 AM

Title: write new GPS-IFD with piexif
Post by: search on June 08, 2021, 09:59:39 AM
Hi all,

I'm writing a python program, where I read the exif data and want to add gps informations. I know, how to read the exif data and add the gps info. But when I use piexif.dump() I always get the error message "Exception has occured: UnboundLocalError. local variable 'new_value' referenced before assignmet. " The error occurs in the Line with piexif.dump(). Here is a sample, how I work.

exif = piexif.load("path/to/picture.jpg")
exif['GPS'] = {1: 'N', 3: 'O', ...}
exif2 = piexif.dump(exif)
piexif.insert(exif2, "path/to/picture.jpg")

I have no variable 'new_value' in my whole source code, so I don't know, wheres the error from. Can anyone help me, please or tell me, where I can find help, if this is the wrong forum.

Thanks.
Search
Title: Re: write new GPS-IFD with piexif
Post by: Phil Harvey on June 08, 2021, 01:44:24 PM
This is the wrong place to ask this question.  You should ask the developer of your Python exif package.

- Phil