Closed lunasorcery closed 11 months ago
This assertion in particular checks that the pixel doesn't have more than 4 channels.
However, it's correct that you can't get less than 8 bits per pixel in RGB and RGBA color modes. Lower bits per pixel are possible only in palette modes.
In this case I was trying to encode in a non-paletted Grey mode, which should support 1,2,4,8,16 bit.
Oh, you're right. I've reworked that check, and released a fix in 3.9.2.
Unless I've missed something, it seems that attempts to encode an image of 1/2/4-bitdepth will fail.
buffer_for_type
checks the data size as such:For an input bitdepth of less than 8,
bytes_per_pixel
will be 0, and then the assert cannot possibly pass unlessPixelType
is somehow a zero-size type.