Skip to content

Fix broken TIFF with JPEG compression #2117

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

Merged
merged 1 commit into from
Jan 3, 2019

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Dec 28, 2018

JPEG compression was one of the cases where we fell back on the TIFFRGBAImage interface of libtiff. This worked for some JPEG images, but crashed on others, inside the TIFF library. Never did figure out why.

But do we really need to to use the RGBAImage interface? Turns out, no! At least, not if it's still a spectral RGB image.

So just using the regular interface for ordinary RGB JPEG-compressed TIFF images is fine, fixes the problem.

Also improved an error message while I was in there.

JPEG compression was one of the cases where we fell back on the
TIFFRGBAImage interface of libtiff. This worked for some JPEG images,
but crashed on others, inside the TIFF library. Never did figure out
why.

But do we really need to to use the RGBAImage interface?  Turns out, no!
At least, not if it's still a spectral RGB image.

So just using the regular interface for ordinary RGB JPEG-compressed
TIFF images is fine, fixes the problem.

Also improved an error message while I was in there.
@lgritz lgritz merged commit 31b030a into AcademySoftwareFoundation:master Jan 3, 2019
@lgritz lgritz deleted the lg-tiffjpeg branch January 3, 2019 06:37
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Jan 3, 2019
JPEG compression was one of the cases where we fell back on the
TIFFRGBAImage interface of libtiff. This worked for some JPEG images,
but crashed on others, inside the TIFF library. Never did figure out
why.

But do we really need to to use the RGBAImage interface?  Turns out, no!
At least, not if it's still a spectral RGB image.

So just using the regular interface for ordinary RGB JPEG-compressed
TIFF images is fine, fixes the problem.

Also improved an error message while I was in there.
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

Successfully merging this pull request may close these issues.

1 participant