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

Started by priyamsaha, May 24, 2023, 04:01:41 AM

Previous topic - Next topic

priyamsaha

Hi, I am using pyexif in one of my scripts and when editing the UserComment field of the EXIF I am getting the below warning:
"Warning: [minor] Entries in ExifIFD were out of sequence. Fixed"The process executes success fully but I get the warning which halts the rest of the python program. Please let me know if there's a way to bypass the warning. Below is the python code for reference:

cwd = 'ps/exif/images'
for f in sorted(os.listdir(cwd)):
        image = Image.open(f)
        metadata = pyexif.ExifEditor(f)
        exif = json.loads(metadata.getTag('UserComment'))
        exif["header"]["device"]="test"
        exif_str = json.dumps(exif)
        metadata.setTag('UserComment', exif_str)

Phil Harvey

You can bypass minor warnings by adding the -m option to the command, but I don't know how to do this via pyexif.

- 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 ($).

StarGeek

Assuming that this is the library you're using, there doesn't seem to be very many options and nothing about the return codes.  You'll have to ask the author about it.

But looking through the code, its options seems quite limited. And it looks like it it doesn't use the -stay_open option, which means it would be running exiftool once for every file, which is Common Mistake #3 and will take longer to process a large number of files.

I would suggest changing to PyExifTool.  It is more complex, but it allows you to directly command exiftool.  It also run exiftool using the -stay_open option and will be faster for a large number of files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype