Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading TIFF image: "tiff directory length is too large" #15

Closed
piponazo opened this issue Jul 4, 2017 · 4 comments
Closed

Error reading TIFF image: "tiff directory length is too large" #15

piponazo opened this issue Jul 4, 2017 · 4 comments
Milestone

Comments

@piponazo
Copy link
Collaborator

piponazo commented Jul 4, 2017

I have this error when trying to read an EXIF image I could perfectly read with the version 0.25:

$ ./exiv2 /tmp/tetracam_image.tif 
Exiv2 exception in print action for file /tmp/tetracam_image.tif:
tiff directory length is too large

I attach the image here so you can analyse the issue. This will block me to update the Exiv2 version in my software

@clanmills
Copy link
Collaborator

It's a multi-page tiff and Exiv2 does not support that. I don't think the error message is very helpful. There's an open issue to work on this. I created a script using some of libtiff utilities to cut the multipage tiff into single page files, modify the metadata and recombine them. Messy. Let me know if that "fix" is useful to you and I'll "point" you to the notes concerning this.

@piponazo
Copy link
Collaborator Author

piponazo commented Jul 4, 2017

But I still have a doubt. How is it possible that this piece of code:

Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(fileName.toUtf8().constData());
image->readMetadata();

Was working on the version 0.25 and now in 0.26 it throws an exception in the readMetadata() function. Is it a new check introduced between 0.25 and 0.26 ?

@clanmills
Copy link
Collaborator

Yes. I added a two new Errors a few weeks ago. Error 55 and 56. Somebody was doing some “fuzzing” on our code and found ways to get us to crash.

I can’t remember if theres something different between v0.25 and v0.26 concerning this.

@clanmills
Copy link
Collaborator

I've remembered the change between v0.25 and v0.26 about this. image->readMetadata() in v0.26 calls image->printStructure(kpsRecursive) and that's where this "too big" thing is detected. In v0.25, I think we recover metadata and write some warnings to errout. In v0.26, we write more warnings to errout and recover the metadata. The current master throws these new errors.

We don't support multi-page tiff. We may have been recovering some metadata, however it's unlikely to be complete. Multi-page tiff is on the list for v0.27 http://dev.exiv2.org/news/3 However, I decided to do user support and mentoring for Exiv2 in 2017. If I do all the development and support, Exiv2 becomes a full-time job. More contributors are needed to work on this stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants