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

Limit FPX tile size to avoid extending outside image #6368

Merged
merged 1 commit into from Jun 16, 2022

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.

None yet

2 participants