mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Explitly import JpegPresets from the PIL package
This commit is contained in:
parent
887f709b6e
commit
f50feb592b
|
@ -36,7 +36,7 @@ __version__ = "0.6"
|
|||
|
||||
import array, struct
|
||||
from PIL import Image, ImageFile, _binary
|
||||
from JpegPresets import presets
|
||||
from PIL.JpegPresets import presets
|
||||
|
||||
i8 = _binary.i8
|
||||
o8 = _binary.o8
|
||||
|
@ -483,7 +483,7 @@ def _save(im, fp, filename):
|
|||
elif subsampling == "keep":
|
||||
if im.format != "JPEG":
|
||||
raise ValueError("Cannot use 'keep' when original image is not a JPEG")
|
||||
subsampling = get_sampling(im)
|
||||
subsampling = get_sampling(im)
|
||||
|
||||
def validate_qtables(qtables):
|
||||
if qtables is None:
|
||||
|
@ -513,7 +513,7 @@ def _save(im, fp, filename):
|
|||
else:
|
||||
qtables[idx] = list(table)
|
||||
return qtables
|
||||
|
||||
|
||||
if qtables == "keep":
|
||||
if im.format != "JPEG":
|
||||
raise ValueError("Cannot use 'keep' when original image is not a JPEG")
|
||||
|
@ -560,7 +560,7 @@ def _save(im, fp, filename):
|
|||
# https://github.com/jdriscoll/django-imagekit/issues/50
|
||||
bufsize=0
|
||||
if "optimize" in info:
|
||||
bufsize = im.size[0]*im.size[1]
|
||||
bufsize = im.size[0]*im.size[1]
|
||||
|
||||
ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)], bufsize)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user