Skip to content

PSD layer co-ordinates may be negative #7706

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

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.

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