You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Freetype pixel mode mono is most-significant bit first, while cairo format A1 is host order, and least-significant-bit first on small-endian platform, such as x86/x86_64.
The text was updated successfully, but these errors were encountered:
I have fixed this in my own code with libtiff successfully, though this seems non-ideal:
# pillow/PIL itself requires libtiff so it is assumed to be around.
# swap the bit-order from freetype's (MSB) to cairo's (host order) if needed
if ( ( byteorder == 'little' ) and (pixel_mode == FT_PIXEL_MODE_MONO ) ):
libtiff = CDLL("libtiff.so")
libtiff.TIFFReverseBits.restype = None
libtiff.TIFFReverseBits.argtypes = (c_void_p, c_int)
libtiff.TIFFReverseBits(buffer.buffer_info()[0], buffer_size)
HinTak
changed the title
Simply wrong code with cairo format_a1 for Bitmap.make_image_surface
Simply wrong code with cairo format_A1 for Bitmap.make_image_surface
Apr 25, 2017
The code around line 3315 for Bitmap.make_image_surface is simply wrong:
Freetype pixel mode mono is most-significant bit first, while cairo format A1 is host order, and least-significant-bit first on small-endian platform, such as x86/x86_64.
The text was updated successfully, but these errors were encountered: