Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Pad IM palette to 768 bytes when saving

Open radarhere opened this issue 3 years ago • 0 comments

#6060 contained a commit entitled "Allow getpalette() to return less than 256 colors"

This meant that there were fewer bytes when saving in IM. https://github.com/python-pillow/Pillow/blob/1d1a22bde37baaf162f4dd26e7b94cd96d3116a2/src/PIL/ImImagePlugin.py#L355

But IM still expected 768 bytes when reading. https://github.com/python-pillow/Pillow/blob/1d1a22bde37baaf162f4dd26e7b94cd96d3116a2/src/PIL/ImImagePlugin.py#L220

So this PR pads the palette to 768 bytes when saving.

radarhere avatar Sep 14 '22 11:09 radarhere