Error reading StripOffsets data in IFD1

Started by peterpix, September 10, 2023, 04:43:01 PM

Previous topic - Next topic

peterpix

I am getting this error message (when hovering over the yellow warning triangle on an image thumbnail) when I try to write metadata to certain images. I am also getting an error message to say that the metadata has not been written, and the yellow write metadata pencil is still there, yet the metadata (keywords and hierarchical keywords) appears (from the metadata panel) to have been written. This appears to be happening with (some but not all) images (tiff and jpeg) exported from Radiant Photo. I would love to know what this error message means.

Peter

Edit: IMatch version is latest, running on Windows 11.

Mario

#1
This message comes from ExifTool, which apparently encountered a problem in your files.
In most cases, this indicates that the files contain bad metadata or some other issue that prevents ExifTool from writing, unless ExifTool considers it safe anyway. But ExifTool returns an error in your case, and IMatch displays that error in the UI so you know that there is a problem.

Tip: If you report such things, always include the IMatch log file from that session (see log file) and provide a sample image that causes this behavior. This gives us a minimum of information to work with.

I have never used Radiant Photo or analyzed the TIFF and JPEG variants they produce. Or if and which metadata they write.

Use the IMatch Metadata Analyst to learn more about the state of these files and problems ExifTool finds in them.

Re-save a TIFF file with this problem in a known-good application like Photoshop or Affinity Photo or your favorite image editor to fix potential problems caused by the other software. Then try to write the files again in IMatch.

You can send two sample files to support email address (with a link back to this topic) (JPG, TIFF straight from the other software) and I will re-save it in Photoshop and Affinity Photo to see if this fixes the problem. If it does, I suspect that the other software has an issue that is detected and reported by ExifTool.

If you do a quick goggle for Error reading StripOffsets data in IFD you'll find a couple of potential reasons for this error message.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

peterpix

Thanks Mario

There are hundreds of files so it is difficult to resave all of them.

I ran Metadata Analyst and got this long list of errors:

  •  Non-standard format (int32s) for IFD0 0x0100 ImageWidth
  •  Non-standard format (int32s) for IFD0 0x0101 ImageHeight
  •  [minor] Non-standard IFD0 tag 0x4746 Rating
  •  [minor] Non-standard IFD0 tag 0x4749 RatingPercent
  •  Wrong IFD for 0x011a XResolution (should be IFD0 not ExifIFD)
  •  Wrong IFD for 0x011b YResolution (should be IFD0 not ExifIFD)
  •  Non-standard format (int32s) for ExifIFD 0xa002 ExifImageWidth
  •  Non-standard format (int32s) for ExifIFD 0xa003 ExifImageHeight
  •  IFD0:StripOffsets is past end of file
  •  ExifIFD tag 0x9010 OffsetTime requires ExifVersion 0231 or higher
  •  [minor] IFD0 tag 0x0100 ImageWidth is not allowed in JPEG
  •  [minor] IFD0 tag 0x0101 ImageHeight is not allowed in JPEG
  •  [minor] IFD0 tag 0x0102 BitsPerSample is not allowed in JPEG
  •  [minor] IFD0 tag 0x0103 Compression is not allowed in JPEG
  •  [minor] IFD0 tag 0x0106 PhotometricInterpretation is not allowed in JPEG
  •  [minor] IFD0 tag 0x0111 StripOffsets is not allowed in JPEG
  •  [minor] IFD0 tag 0x0115 SamplesPerPixel is not allowed in JPEG
  •  [minor] IFD0 tag 0x0116 RowsPerStrip is not allowed in JPEG
  •  [minor] IFD0 tag 0x0117 StripByteCounts is not allowed in JPEG
  •  [minor] IFD0 tag 0x011c PlanarConfiguration is not allowed in JPEG
  •  [minor] Missing required JPEG IFD0 tag 0x0213 YCbCrPositioning

Also:

[ExifIFD]:UserComment not mapped to [XMP-dc]:Description (embedded).

But I don't know what any of that means.

I've emailed Radiant Photo with a sample image. I will send some sample images to you also.

Best

Peter

Mario

#3
QuoteIFD0:StripOffsets is past end of file

This is the main problem. A "strip offset" is a pointer that points at a specific byte address inside an image file.
Applications use these pointers to find stuff in the file and to read data.
Your image contains pointers that point "outside" the file (at addresses larger than the file) which makes them invalid.
ExifTool detected this and considers the file as damaged. Hence the error message.

There are also some other issues which indicate that the EXIF data produced by the other software does not follow the EXIF standard.

Quote[ExifIFD]:UserComment not mapped to [XMP-dc]:Description (embedded).

This means that the other software has written an EXIF user comment, but did not mirror the comment into the XMP-dc:Description tag as required by the MWG and industry practice.

IMatch/ExifTool usually take care for this by properly mapping between XMP and EXIF / GPS / IPTC during write-back, ensuring that the data that exists in multiple metadata formats is properly synchronized.
Since write back is not successful for the files, this cannot happen.

Many software products out there don't do care for proper mapping between different metadata formats that co-exist in the same image - causing different values to exist e.g. in EXIF and XMP.
(Which is more or less harmless for things like UserComment, but can become problematic if EXIF and XMP have different values for the same time stamps).

Probably Radiant Photo does not prioritize proper metadata handling very high. Ahem...
Only they can fix this.

This is another example for what I describe as metadata mess.
Applications, even from bigger vendors, not putting in the work and giving a sh*t for proper metadata handling and standard compliance.

This usually boils up in IMatch since IMatch cares for metadata and goes the extra mile to produce rich, complete and standard-compliant metadata in your files. And to detect issues with metadata in your files and inform you about problems detected.

Or it boils up when you try to open your files in other image editors or on other platforms.
Suddenly, some files are not readable, in the "wrong format", metadata is not found or the images look "funny".
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

peterpix

Mario thanks, that is very helpful indeed. As always iMatch achieves the highest of standards, and your support is second to none. A wonderful app. I'm very glad I switched to it several years ago.

Mario

I did looked at the files you've sent.
I cannot add much to the analysis of the Metadata Analyst. ExifTool writes XMP metadata but refuses to update EXIF data because of the invalid offsets.

Re-saving the files in Photoshop did not change anything since Photoshop does not touch these areas.

Re-saving in a "dumb" image editor stripped the existing EXIF / IFD data and that fixed the problem (but also lost existing metadata).

Running the ExifTool Command Processor with these arguments to remove the broken IFD0 record also fixed the problem, without losing XMP or EXIF data:

# im-warn
-overwrite_original_in_place
-ifd0:all=
-charset
filename=UTF8
{Files}

The next write-back is successful and ExifTool recreates the IDF0 data block correctly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

joe

Just sharing for others that encounter this issue and are looking for solutions. I had the exact subject IFD1 error in a couple files as well. I couldn't patch any of the Metadata Analyst-identified errors due to this corruption. However, I tried the solution mentioned here in the ExifTool forum. It worked well and even kept my tags.