Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Jun 15, 2022

FPX doesn't currently have any valid test images, only an image with an invalid number of bands.

def test_fpx_invalid_number_of_bands():
with pytest.raises(OSError, match="Invalid number of bands"):
with Image.open("Tests/images/input_bw_five_bands.fpx"):
pass

If I take that image, and hexedit the number of bands to 1 (as seems appropriate for 'input_bw'), then the image opens successfully. Trying to load() it, I then get "ValueError: tile cannot extend outside image".

This PR limits the size of the FPX tiles to avoid extending outside the image, allowing the new image to be loaded.

@radarhere radarhere changed the title Limit FPX raw tile size to avoid extending outside image Limit FPX tile size to avoid extending outside image Jun 15, 2022
@hugovk hugovk merged commit b3bc4a7 into python-pillow:main Jun 16, 2022
@radarhere radarhere deleted the fpx branch June 16, 2022 09:05
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.

2 participants