mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
Merge pull request #5647 from radarhere/transform_palette
This commit is contained in:
commit
afebfcb096
|
@ -32,6 +32,11 @@ class TestImageTransform:
|
|||
new_im = im.transform((100, 100), transform)
|
||||
assert new_im.info["comment"] == comment
|
||||
|
||||
def test_palette(self):
|
||||
with Image.open("Tests/images/hopper.gif") as im:
|
||||
transformed = im.transform(im.size, Image.AFFINE, [1, 0, 0, 0, 1, 0])
|
||||
assert im.palette.palette == transformed.palette.palette
|
||||
|
||||
def test_extent(self):
|
||||
im = hopper("RGB")
|
||||
(w, h) = im.size
|
||||
|
|
|
@ -2479,6 +2479,8 @@ class Image:
|
|||
raise ValueError("missing method data")
|
||||
|
||||
im = new(self.mode, size, fillcolor)
|
||||
if self.mode == "P" and self.palette:
|
||||
im.palette = self.palette.copy()
|
||||
im.info = self.info.copy()
|
||||
if method == MESH:
|
||||
# list of quads
|
||||
|
|
Loading…
Reference in New Issue
Block a user