mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 05:34:36 +03:00
Merge pull request #5353 from radarhere/quantize_attributes
Use quantization method attributes
This commit is contained in:
commit
5e1d304769
|
@ -1080,11 +1080,11 @@ class Image:
|
||||||
|
|
||||||
if method is None:
|
if method is None:
|
||||||
# defaults:
|
# defaults:
|
||||||
method = 0
|
method = MEDIANCUT
|
||||||
if self.mode == "RGBA":
|
if self.mode == "RGBA":
|
||||||
method = 2
|
method = FASTOCTREE
|
||||||
|
|
||||||
if self.mode == "RGBA" and method not in (2, 3):
|
if self.mode == "RGBA" and method not in (FASTOCTREE, LIBIMAGEQUANT):
|
||||||
# Caller specified an invalid mode.
|
# Caller specified an invalid mode.
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Fast Octree (method == 2) and libimagequant (method == 3) "
|
"Fast Octree (method == 2) and libimagequant (method == 3) "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user