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
EOF exception with Tiff Images on rotation #315
Comments
As already mentioned, I believe this is the same issue as #306 (bug in the line length computation in the LZW compression). I don't see what is different in this issue than what we already know from #310 (and #306, #312 and #314). I would guess (without testing) that it would work fine if you changed from LZW to Deflate compression for now. As already mentioned, I will work on fixing these bugs as soon as possible (but as it's mostly me doing development on my spare time, that may not be as quickly as any of us would like). Best regards, -- |
Ok Thanks Harald..We will wait for the fix. |
After the latest changes, I ran (a slightly edited* version of) your code above and it worked fine with the input data from #310 + #307 (except the JBIG data, which I still can't read). I could then re-run the program multiple times (I stopped after 4 times), without problems. For each step, I also manually inspected the files in macOS Preview and the TIFFImageReader, and the looked good each time. Please verify, or update the issue with further details to reproduce. *) I don't know what's in your pageRotationMap, so I just hardcoded ImageWriteParam param = imageWriter.getDefaultWriteParam();
if ("Old JPEG".equals(compressionType)) {
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionType("JPEG");
}
else if (compressionType.equals("Unknown 50013")) {
// Currently a limitation in the metadata class, doesn't recognise the PIXTIFF ZIP compression
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionType("Deflate");
}
imageWriter.writeToSequence(new IIOImage(imageList.get(i), null, metadataList.get(i)), param); -- |
Thanks a lot Harald. I did some test and found some issues:
2)CCITT RLE - image blackens when we just read and write 3)4 bit Gray LZW - EOF Exception - reading the image 3rd time(read, write and read the same image) 4)Binary LZW - EOF Exception - when I read , rotate , write and read the same image |
Hi,
PS: Can we close #310 for now, and continue trouble-shooting in this issue? I'll file separate bugs for each bug I'm able to reproduce in addition, to keep things somewhat tidy. -- |
Okay, so I think I found the bug in the LZW encoding. Currently, the length of the LZW buffer is calculated based like Should be fixable. 😀 PS: There's a (completely unrelated to the bug) rounding error in your code, so that for each step of 90 degrees rotation, a little of the image is chopped off. This is caused by the integer division in the -- |
Committed a fix now, please pull and build from latest master, to see if that solves your issues. With the fix I can now run the 90 degree rotation of all pages in the 132 page doc, 4 times in a row, and end up with pretty much the same as the starting point (meta data and some file layout is changed, but pixel data should be the same). -- |
I see. I need to look into this last issue a little bit more, to determine what the problem is. The So... Either there's bug in both the reader and writer, or the combination of CCITT compression and BlackIsZero photometric interpretation is just very exotic and not widely supported.... According to the TIFF 6.0 Specification, Section 11: CCITT Bilevel Encodings:
The samples use the modified Huffman compression (Compression: 2), but essentially the same text is found in Section 10: Modified Huffman Compression. Because the most "natural" mode for Java is BlackIsZero, I convert the values when reading, and write the values as-is. So a read-write cycle will change from WhiteIsZero to BlackIsZero. But still, I believe everything is implemented correctly, according to the spec. It's of course unfortunate if this differs from what other software thinks, so we might want to change that behavior... PS: Incidentally, if I view the images in gmail, they look the same too. -- |
ok .. Any approximate timeline for 3.3.2 release? |
Hopefully this week. -- |
Hi Harald, Will the release happen anytime this week? looks like it didn't happen last week. |
Hi again, Sorry, but I can't promise any release date. Until someone pays for the hours I put into the project, I only have my spare time to spend, and with a family, this time is limited. Unfortunately, the job of merging the bug fixes down to the 3.3 branch was more time consuming than I first thought. I'll see what I can do this week though. -- |
Yes .. i understand!
Thanks.
On Jan 31, 2017 01:25, "Harald Kuhr" <notifications@github.com> wrote:
Hi again,
Sorry, but I can't promise any release date. Until someone pays for the
hours I put into the project, I only have my spare time to spend, and with
a family that is only so much.
Unfortunately, the job of merging the bug fixes down to the 3.3 branch was
more time consuming than I first thought. I'll see what I can do this week
though.
…--
Harald K
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#315 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALmREJSsUDXJUKlAFdaL_00rZJT2XOTAks5rXkAbgaJpZM4LkUZs>
.
|
Hi, I just released 3.3.2. Binaries should be available through Maven Central within a few hours. Best regards, -- |
Thanks a lot Harald
…On Feb 3, 2017 02:34, "Harald Kuhr" ***@***.***> wrote:
Hi,
I just released 3.3.2. Binaries should be available through Maven Central
within a few hours.
Best regards,
--
Harald K
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#315 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALmREClb-8cusFv7EFe1IKVk5oHYz5z_ks5rYkTugaJpZM4LkUZs>
.
|
Hi,
If I read a Tiff image, rotate it and write and repeat this once again. Third time when I read the Tiff Image I get EOF Exception . I get this Exception with almost all compression types of Tiff.
Is rotation doing something wrong or #306 will fix this issue as [well?]
The text was updated successfully, but these errors were encountered: