Pillow
Pillow copied to clipboard
Python Imaging Library (Fork)
### What did you do? I opened a truncated image file and converted it to an array to check the validity of the file. (The equivalent of [this test](https://github.com/radarhere/Pillow/blob/e5046b1057f24794ea83f694ecd23a404873853b/Tests/test_image_array.py#L39-L41), though...
A nicer solution would be to switch to an enum with the right values, but this is the quick win. Tested locally, ran through pycodestyle. To me it seems the...
Resolves #6588 For NumPy < 1.23, if an error is raised when converting an image to a NumPy array, #6394 allowed NumPy to catch that, preventing the user from seeing...
Resolves #6590 At the moment, the first frame of a GIF is never RGBA. https://github.com/python-pillow/Pillow/blob/b8d96246f71753cbd8aaafc6dc633cad3aad0317/src/PIL/GifImagePlugin.py#L302-L308 This PR changes it to be RGBA if there is transparency and `LoadingStrategy.RGB_ALWAYS` is used....
Small improvement of the docs. Have a nice day :)
Resolves #6515 If `align="center"` is used for `multiline_text`, https://github.com/python-pillow/Pillow/blob/4c59f77e37e7333544a5d0910de8148f7972ed06/src/PIL/ImageDraw.py#L562-L570 then `coord` can be a float for the `embedded_color` paste. But when pasting one image onto another, the co-ordinates must be...
### What did you do? I saved 2 copies of a webp file, one with exif=exif_bytes as shown, one without, then added the exif data by piexif.insert ### What did...
Resolves #6580 As seen before in #4677, WebP images do not require the `b"Exif\x00\x00"` prefix in their EXIF data. This PR removes it when saving, for the sake of creating...
#6060 contained a commit entitled "[Allow getpalette() to return less than 256 colors](https://github.com/python-pillow/Pillow/pull/6060/commits/948c064b282f80492f5b88d3f06a599b76516edf)" 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...
Currently many of the pytest tests start with a loop over a list of some values, with all of the test code inside this loop. https://github.com/python-pillow/Pillow/blob/4dd678a2e77a5111ca388187e599b986b7ad43bc/Tests/test_image_paste.py#L104-L112 Instead, we can use...