write new GPS-IFD with piexif

Started by search, June 08, 2021, 09:59:39 AM

Previous topic - Next topic

search

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

Phil Harvey

This is the wrong place to ask this question.  You should ask the developer of your Python exif package.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).