Update PdfImagePlugin.py

PDF FlateDecode add params
This commit is contained in:
白月秋见心 2022-11-12 11:07:48 +08:00 committed by GitHub
parent 61d31d0597
commit 2bdcd00527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,6 +194,13 @@ def _save(im, fp, filename, save_all=False):
elif filter == "DCTDecode":
Image.SAVE["JPEG"](im, op, filename)
elif filter == "FlateDecode":
params = PdfParser.PdfDict(
{
"Predictor": 15,
"Columns": width,
"Colors": 3,
}
)
ImageFile._save(im, op, [("zip", (0, 0) + im.size, 0, im.mode)])
elif filter == "RunLengthDecode":
ImageFile._save(im, op, [("packbits", (0, 0) + im.size, 0, im.mode)])