mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-02 19:40:10 +03:00
Merge 2d478fe82a
into d6f597a1ad
This commit is contained in:
commit
4410848bb4
|
@ -628,10 +628,10 @@ class Image:
|
||||||
self.palette.mode = "RGB"
|
self.palette.mode = "RGB"
|
||||||
self.palette.rawmode = None
|
self.palette.rawmode = None
|
||||||
if "transparency" in self.info:
|
if "transparency" in self.info:
|
||||||
if isinstance(self.info["transparency"], str):
|
if isinstance(self.info["transparency"], int):
|
||||||
self.im.putpalettealphas(self.info["transparency"])
|
|
||||||
else:
|
|
||||||
self.im.putpalettealpha(self.info["transparency"], 0)
|
self.im.putpalettealpha(self.info["transparency"], 0)
|
||||||
|
else:
|
||||||
|
self.im.putpalettealphas(self.info["transparency"])
|
||||||
self.palette.mode = "RGBA"
|
self.palette.mode = "RGBA"
|
||||||
|
|
||||||
if self.im:
|
if self.im:
|
||||||
|
|
|
@ -932,7 +932,7 @@ _getpalettemode(ImagingObject* self, PyObject* args)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PyString_FromString(self->image->palette->mode);
|
return PyUnicode_FromString(self->image->palette->mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
|
|
Loading…
Reference in New Issue
Block a user