Directory SubImage size Error after EXIF warning

Bug #603923 reported by Djainette on 2010-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Running phatch 0.2.7 on Ubuntu 10.04, adding a png watermark on a jpg file and saving it as a new jpg in a subdirectory.
If EXIF is unchecked in the "save" action (sorry, translating from a french GUI), everything is fine and the batch is processed quite quickly.

But if EXIF is checked, the process lags a bit on each picture and the terminal says

Warning: Directory SubImage1, entry 0x0009 has unknown Exif (TIFF) type 0; setting type size 1.
Error: Directory SubImage1, entry 0x0009 has invalid size 2450063363*1; skipping entry.
Error: Directory SubImage2 with 37385 entries considered invalid; not read.

The picture originally was a .nef RAW file, converted to jpg by Rawtherapee alpha3 and resized in GIMP (no TIFF anywhere in that workflow).

Djainette (djainette) wrote :
robinmills (robinmills) wrote :

This sounds like an issue that involves the exiv2 library and your image. Can you add the image to this bug report and I'll investigate. Perhaps you could do the first step and the investigation by install the exiv2 application and running it on the image:

$ sudo apt-get install exiv2
$ exiv2 -pt logo_photo_big.png

If that's OK, then I'll dig around a bit more and see what's the matter.

Djainette (djainette) wrote :

Thanks for your quick answer.
run exiv2 on the png watermark image as recommended, and got no output whatsoever. On the original file I want to watermark though, got the same error as before (unknown EXIF).
Output attached.

Stani (stani) wrote :

Please attach an image with which we can reproduce this error. Otherwise it is impossible for us to fix.

Changed in phatch:
status: New → Incomplete
Djainette (djainette) wrote :

Here's a resized image (don't know what the attachment size limit is) that reproduce the error.

FYI, when running the action on a single file instead of a whole directory I get one more "out of bounds" error :
Error: Directory SubImage1: Next pointer is out of bounds; ignored.

robinmills (robinmills) on 2010-07-11
Changed in phatch:
assignee: nobody → robinmills (robinmills)
robinmills (robinmills) wrote :

I am still unable to reproduce this (with Phatch 0.2.7 on Ubuntu 10.04) Can you send the watermark image please?

Those messages are coming from the C++ code in the exiv2 library. Although TIFF doesn't feature in your workflow, the message is a little confusing. It's odd that it runs OK when you don't check the exif option and that exiv2 gave no output at all for your watermark image.

Could you also try with a different watermark file? (and/or image). The image seems OK to me.

Djainette (djainette) wrote :
Djainette (djainette) wrote :

Used the watermark on a .bmp file without any problem. It seems the problem lies with the .jpg input file.

robinmills (robinmills) wrote :

Thanks for sending the watermark. I'll look at this after work. Are you certain that the error occurs with the files attached to this bug report?

Djainette (djainette) wrote :

Just re-downloaded the file to check :
Error: Directory SubImage1: Next pointer is out of bounds; ignored.
Warning: Directory SubImage1, entry 0x0003 has unknown Exif (TIFF) type 0; setting type size 1.
Error: Directory SubImage1, entry 0x0003 has invalid size 2449997827*1; skipping entry.
Error: Directory SubImage2 with 37384 entries considered invalid; not read.

robinmills (robinmills) wrote :

Thanks. That's very helpful. I investigate this evening.

robinmills (robinmills) wrote :

Good News: I can reproduce this. I'm quite certain that the messages are from the exiv2 library.

I agree with you that it's the image (and not the watermark) that's causing the trouble. I now understand that the error messages (from exiv2) are on stdout (or errout) - so when I run Phatch from terminal I can see the messages.

Right. I'll dive down into exiv2 and find out what this is about. I've been on vacation and I have a list of other tasks which I've promised to complete for other folks. So, if it's OK with you, I'll look at this again at the weekend.

robinmills (robinmills) wrote :

Good news. I've got a fix. The latest exiv2 library (0.20) fixes this.

I downloaded the code from the exiv2 web site and built it from source. I also built and installed expat and zlib. I renamed /usr/lib/ to hide it - so that the hand-build /usr/local/lib/ would get loaded. Now phatch is happy (and fast - the strange delay has gone).

You may be fortunate and the Package manager will download and install exiv2 0.20 for you. (sudo apt-get install exiv2). exiv2 -V will tell you the version. If you need assistance to build exiv2 from source, let me know and I'll try to help.

I had a look at the bug list on the exiv2 web site and I didn't see a bug report which made me say "ah, yes - there's the culprit". However I think that's only a matter of more digging. I could ask our friend Andreas if he recalls this issue.

Anyway, I hope this fixes things for you.

Djainette (djainette) wrote :

Thanks for your vacation time anyway :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers