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

Open 1 bit EPS in mode 1 #6499

Merged
merged 1 commit into from Aug 30, 2022
Merged

Open 1 bit EPS in mode 1 #6499

merged 1 commit into from Aug 30, 2022

Conversation

radarhere
Copy link
Member

Resolves #6382

When reading an encoded bitmap image in an EPS image, Pillow uses the information contained within the comment to set the image mode.

# Encoded bitmapped image.
x, y, bi, mo = s[11:].split(None, 7)[:4]
if int(bi) != 8:
break
try:
self.mode = self.mode_map[int(mo)]
except ValueError:
break

Unless the bitmap depth is not 8, then it doesn't. This PR sets the mode to 1 if the bitmap depth is 1.

For more information about the comment structure, see http://paulbourke.net/dataformats/psdpsb/psdpsb.html#50577413_61897

The test image image comes from the issue.

@hugovk hugovk merged commit 96441fb into python-pillow:main Aug 30, 2022
@radarhere radarhere deleted the eps branch August 30, 2022 22:06
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.

Bitmap ".eps" image have incorrect size and mode
2 participants