| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
I had been looking at removing ImagingConvertInPlace (in a bid to see if the shuffler functions could be implemented in a faster way) but didn't dare go through with it.
Some thoughts within though :)
Sorry, something went wrong.
| static PyObject * | ||
| im_setmode(ImagingObject *self, PyObject *args) { | ||
| im_setalpha(ImagingObject *self, PyObject *args) { | ||
| /* attempt to modify the mode of an image in place */ |
There was a problem hiding this comment.
This comment is a little stale now?
Sorry, something went wrong.
There was a problem hiding this comment.
Is it? The method is still modifying the mode of an image in place. It's more specific now, is all.
Sorry, something went wrong.
There was a problem hiding this comment.
I suppose...
Should this function know how to do P-to-PA and L-to-LA too?
Sorry, something went wrong.
There was a problem hiding this comment.
The thought occurred to me. It is a bit different to RGB, since RGB already has the same pixelsize as RGBA.
Do you mind if that is a follow-up PR? I would rather tidy things up first.
Sorry, something went wrong.
|
I'll click the rebase button to test automerge (#9126) on a non-docs PR:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
im.putalpha() is the only place where C's setmode() is called.
Pillow/src/PIL/Image.py
Lines 2050 to 2052 in 3220aca
This is only trying to convert the image to LA, PA or RGBA.
However, the only operation setmode() can actually succeed at is converting RGB or RGBX to RGBA.
Pillow/src/_imaging.c
Lines 2079 to 2090 in 3220aca
Pillow/src/libImaging/Convert.c
Lines 1739 to 1748 in 3220aca
ImagingConvertInPlace() isn't able to convert anything to LA, PA or RGBA.
So this PR