1

I get the following exception when calling BitmapMetadata.GetQuery("/app13/irb/8bimiptc/iptc") on about 1% of JPEGs I have tried this on. What could be causing this and what can I do to fix it? (I have tried Googling but I can only find one relevant result asking the same question but with no answer.)

System.OverflowException:
The image data generated an overflow during processing. ---> 
System.Runtime.InteropServices.COMException (0x88982F05): 
Exception from HRESULT: 0x88982F05
--- End of inner exception stack trace ---
at System.Windows.Media.Imaging.BitmapMetadata.GetQuery(String query)
at MyProject.ImageRecord..ctor(String file)
in C:\MyProject\ImageRecord.cs:line 93
The image data generated an overflow during processing.

Edit:

The exiv2 tool reports:

Error: Invalid Photoshop IRB data size 6372
2
  • Could you post a JPEG that has this problem so that I can look into it? May 26, 2009 at 15:52
  • Unfortunately I cannot post an example as some of the IPTC data is copyrighted, and if I edit it out then the exception will not reproduce.
    – Liam
    May 27, 2009 at 9:49

3 Answers 3

1
+100

My guess is that the Photoshop IRB data is longer than the header specifies.

At least this is what I can deduct by skimming over the source of Exiv2 (line 107):

http://dev.exiv2.org/repositories/entry/exiv2/trunk/src/jpgimage.cpp?rev=1146

But my understanding of c is not that good! :)

3
  • Thanks, I wonder if there are any tools for correcting such errors in the headers?
    – Liam
    May 29, 2009 at 12:03
  • I came across this error again, Googled it, and found my old question here. This time around I added a try..catch block, logged the names of the problem files, and fixed them by opening them in XnView, and selecting Edit > Metadata > Edit IPTC data > Write .
    – Liam
    Oct 10, 2012 at 11:29
  • Any suggestions for doing this for a large batch of images?
    – Liam
    Oct 10, 2012 at 13:57
1

Error 0x88982F05 is only regular value-out-of-range error by WIC Thus it can be easely handled by you. Also this might not be your only problem with IPTC query strings. Just try {} catch {} this section like this to graceful fallover

if (bitmapMetadata.GetQuery(MY_QUERY) != null &&) {
try { 
... }
catch {}
0

Based on the information reported by exiv2, the size of the Photoshop IRB information is inconsistent with the overall size of the metadata.

If you wish to ignore the messages I would be more specific in the the type of exception you catch -- only ignore or report that particular COM Exception.

A couple of tools/resources out there:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.