Error reading IPTC fields from JPEG in .NET.
I am getting the following exception when calling BitmapMetadata.GetQuery ("/ app13 / irb / 8bimiptc / iptc") on about 1% JPEG. I've tried this. What could be causing this and what can I do to fix it? (I tried Google, but I can only find one relevant result asking the same question but 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 tool exiv2
reports:
Error: Invalid Photoshop IRB data size 6372
a source to share
I am assuming the IRB data of Photoshop is longer than stated in the title.
At least this is what I can subtract by going through the Exiv2 source (line 107):
http://dev.exiv2.org/repositories/entry/exiv2/trunk/src/jpgimage.cpp?rev=1146
But my understanding of c is not that good! :)
a source to share
Error 0x88982F05 is just a regular error outside of the WIC range So you can deal with it easily. Also it might not be the only problem with IPTC query strings. Just try {} catch {} this section like this for a nifty pattern
if (bitmapMetadata.GetQuery(MY_QUERY) != null &&) {
try {
... }
catch {}
a source to share
Check this post - fixed my problem
http://getsatisfaction.com/livelabs/topics/deepzoomtools_dll_exception_from_hresult_0x88982f05
Based on the information provided by exiv2, the size of Photoshop's IRB information is incompatible with the overall metadata size.
If you want to ignore the messages, I would be more specific about the type of exception you are throwing - just ignore or report this particular COM exception.
Several tools / resources:
a source to share