Specific JPEG file won’t accept certain tags

Started by mazeckenrode, April 30, 2025, 09:12:37 PM

Previous topic - Next topic

mazeckenrode

I have a JPEG which I can't write certain metadata to — as far as I can tell so far, primarily EXIF metadata. I even opened it in IrfanView, made some minor color corrections, saved it as a new file and tried to write the tags again, but I'm still getting errors.


ExifTool -m "-EXIF:CreateDate<File:FileCreateDate" "-XMP:DateTimeDigitized<File:FileCreateDate" "-IPTC:DigitalCreationDate<File:FileCreateDate" "-IPTC:DigitalCreationTime<File:FileCreateDate" "[2001 RCA+BMG 07863_69383-2] CD.jpg"
Warning: Bad IFD2 directory - [2001 RCA+BMG 07863_69383-2] CD.jpg
Error: Bad format (0) for IFD1 entry 2 - [2001 RCA+BMG 07863_69383-2] CD.jpg
    0 image files updated
    1 files weren't updated due to errors

ExifTool -m "-XMP:DateTimeDigitized<File:FileCreateDate" "-IPTC:DigitalCreationDate<File:FileCreateDate" "-IPTC:DigitalCreationTime<File:FileCreateDate" "[2001 RCA+BMG 07863_69383-2] CD.jpg"
Warning: Bad IFD2 directory - [2001 RCA+BMG 07863_69383-2] CD.jpg
    1 image files updated

ExifTool -m "-IPTC:DigitalCreationDate<File:FileCreateDate" "-IPTC:DigitalCreationTime<File:FileCreateDate" "[2001 RCA+BMG 07863_69383-2] CD.jpg"
Warning: Bad IFD2 directory - [2001 RCA+BMG 07863_69383-2] CD.jpg
    1 image files updated

The XMP and IPTC both got written — though only after I eliminated the EXIF tag operations from the command line — but EXIF did not. For what it's worth, this file also already contained the following values:

EXIF:ImageWidth: 160
EXIF:ImageHeight: 120
EXIF:StripByteCounts: 57600

The actual image is 1488 x 1520, so the first two above don't make sense to me. And then there is the fact that I have other related images which do not already contain any of those tags — I would have guessed that ImageWidth and ImageHeight would be present in every image file, no?

Anyway, this is a scan of a commercial music CD, so I'm guessing not suitable for upload to this forum due to copyright. Any merit in emailing it (or a link to it) to you, Phil?

Phil Harvey

ExifTool won't write the corrupted EXIF in this JPEG because doing so would likely cause more damage.  The only way to write this would be to first repair the EXIF, although you still run the risk of losing some metadata.  See FAQ 20 for more information.

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

mazeckenrode