pyexif icon indicating copy to clipboard operation
pyexif copied to clipboard

Warning: [minor] Entries in ExifIFD were out of sequence. Fixed

Open priyamsaha opened this issue 2 years ago • 0 comments

When using the setTag() function inside a for loop(multiple files in a directory), I am getting the following error: "Warning: [minor] Entries in ExifIFD were out of sequence. Fixed". And the for loop halts for a while like 2-3 mins and then continues. Is there a fix to this or am I doing something wrong? Please find my code snippet below:

cwd=os.getcwd()
for f in sorted(os.listdir(cwd)):
  try:
        image = Image.open(f)
        metadata = pyexif.ExifEditor(f)
        exif = json.loads(metadata.getTag('UserComment'))
        exif["header"]["device_id"]="m02-test"
        exif_str = json.dumps(exif)
        metadata.setTag('UserComment', exif_str)

priyamsaha avatar May 25 '23 07:05 priyamsaha