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

PSD layer co-ordinates may be negative #7706

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

radarhere
Copy link
Member

Resolves #7704

At the moment, Pillow reads the top left co-ordinates of a PSD layer as unsigned, meaning that they can't be negative.

# bounding box
y0 = i32(read(4))
x0 = i32(read(4))

However, the issue has found a PSD file where a layer does have a negative Y offset. This PR adjusts the reading of the co-ordinates to be signed, so that they can be negative.

I created a test file using GIMP.

@hugovk hugovk merged commit 94f319c into python-pillow:main Mar 11, 2024
56 checks passed
@radarhere radarhere deleted the psd branch March 12, 2024 00:54
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.

Image.open() fails with struct.error with Photoshop .psd files
2 participants