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

Fix bits value for RGB;16N unpackers #3837

Merged
merged 1 commit into from May 9, 2019

Conversation

kkopachev
Copy link
Contributor

Fixes #3770 . Fixes #3832.

Changes proposed in this pull request:

Change bits value for RGB;16N unpackers. bits used in TiffDecode.c to calculate row size of a tile in bytes.

@kkopachev
Copy link
Contributor Author

It was originally introduced in 768668c but I guess bits are not directly used as much as I expected, so it became a problem when newer tiff decode code started relying on bits in #3489

@kkopachev
Copy link
Contributor Author

Appveyor failure is totally unrelated to the proposed changes.

@radarhere
Copy link
Member

Thanks for this. Are you able to add tests, that fail without this PR and pass with it?

@kkopachev
Copy link
Contributor Author

I can only think about adding reading 16bit Tiff file as a test, but that would be indirect test. Not sure how to test just for bits value. Any suggestions?

@radarhere
Copy link
Member

Reading a 16-bit TIFF file and comparing the result to another image should be right - testing just the unpacker entry value sounds rather specific.

@kkopachev kkopachev force-pushed the issue-3770 branch 2 times, most recently from c77f450 to 5482ace Compare May 9, 2019 19:56
@kkopachev
Copy link
Contributor Author

Added test.

Test image is derived from existing test image Tests/images/tiff_16bit_RGBa.tiff using

gdal_translate -co "TILED=YES" -co COMPRESS=DEFLATE tiff_16bit_RGBa.tiff -b 1 -b 2 -b 3 tiff_16bit_RGB.tiff

@radarhere
Copy link
Member

I rebased on master so that AppVeyor could try again. Although Azure is now experiencing problems, at least Travis and AppVeyor are passing now.

@radarhere radarhere merged commit 524c302 into python-pillow:master May 9, 2019
@kkopachev kkopachev deleted the issue-3770 branch May 9, 2019 23:17
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.

16 Bit Deflate tiff Image Corrupt Compressed GeoTiff with GDAL no longer plotting with version 6.0.0
2 participants