Pillow
Pillow copied to clipboard
Pad IM palette to 768 bytes when saving
#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.