Skip to content

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