Add support for reading TIFFs with PlanarConfiguration=2#5178
Add support for reading TIFFs with PlanarConfiguration=2#5178wiredfool wants to merge 12 commits intopython-pillow:masterfrom
Conversation
|
I'm afraid I don't have the setup to debug the windows side of this at the moment. |
|
I am not familiar with Windows specifics here, but here is some observations: |
|
@nulano Do you have any insight into this? |
| shuffler((UINT8*) im->image[tile_y + y] + x * im->pixelsize, | ||
| state->buffer + current_line * row_byte_size, | ||
| current_tile_width | ||
| ); |
There was a problem hiding this comment.
I'm not yet sure what is going on, but compiling with debug information shows that state->buffer is NULL on this line even though it was valid on line 587 for the realloc call.
The error doesn't show up when compiling with in a debug build (setup.py build_ext --dubug), I had to change setup.py line 852 to Extension("PIL._imaging", files, extra_compile_args=["/Z7"], extra_link_args=["/DEBUG"]), and copy the PDB to the PIL directory.
src/libImaging/TiffDecode.c
Outdated
| uint16 photometric = 0; // init to not PHOTOMETRIC_YCBCR | ||
| int isYCbCr = 0; | ||
| UINT8 planarconfig = 0; | ||
| UINT8 planes = 1; |
There was a problem hiding this comment.
@kkopachev Is there any reason to use UINT8 for planes? It looks to me like it would make more sense to use int.
There was a problem hiding this comment.
Yeah, should be just int 🤦
src/libImaging/TiffDecode.c
Outdated
| // if number of bands is 1, there is no difference with contig case | ||
| if (planarconfig == PLANARCONFIG_SEPARATE && | ||
| im->bands > 1 && | ||
| photometric != PHOTOMETRIC_YCBCR) { |
There was a problem hiding this comment.
| photometric != PHOTOMETRIC_YCBCR) { | |
| !isYCbCr) { |
Fix win32/s390x for PR4641
nulano
left a comment
There was a problem hiding this comment.
Same as UINT8 planes -> int planes.
src/libImaging/TiffDecode.c
Outdated
| state->errcode = IMAGING_CODEC_BROKEN; | ||
| return -1; | ||
| } | ||
| UINT8 plane; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/libImaging/TiffDecode.c
Outdated
| * backwards | ||
| */ | ||
|
|
||
| UINT8 plane; |
There was a problem hiding this comment.
| UINT8 plane; | |
| int plane; |
|
@wiredfool I have some changes I did on top of this PR to fix BigEndian skipped tests and a bit of refactoring. Do you want me to create PR into this branch or wait until this merged and open into Pillow:master afterwards for separate review? |
|
Might as well pr to this branch |
Uh oh!
There was an error while loading. Please reload this page.