mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-16 03:20:53 +03:00
Do not use MozJPEG progressive default
This commit is contained in:
parent
06e02cc1d9
commit
ae59b03956
|
@ -281,6 +281,9 @@ class TestFileJpeg:
|
|||
assert not im2.info.get("progressive")
|
||||
assert im3.info.get("progressive")
|
||||
|
||||
if features.check_feature("mozjpeg"):
|
||||
assert_image_similar(im1, im3, 9.39)
|
||||
else:
|
||||
assert_image_equal(im1, im3)
|
||||
assert im1_bytes >= im3_bytes
|
||||
|
||||
|
@ -424,6 +427,10 @@ class TestFileJpeg:
|
|||
|
||||
im2 = self.roundtrip(hopper(), progressive=1)
|
||||
im3 = self.roundtrip(hopper(), progression=1) # compatibility
|
||||
if features.check_feature("mozjpeg"):
|
||||
assert_image_similar(im1, im2, 9.39)
|
||||
assert_image_similar(im1, im3, 9.39)
|
||||
else:
|
||||
assert_image_equal(im1, im2)
|
||||
assert_image_equal(im1, im3)
|
||||
assert im2.info.get("progressive")
|
||||
|
|
|
@ -135,6 +135,15 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
|
|||
}
|
||||
|
||||
/* Compressor configuration */
|
||||
#ifdef JPEG_C_PARAM_SUPPORTED
|
||||
/* MozJPEG */
|
||||
if (!context->progressive) {
|
||||
/* Do not use MozJPEG progressive default */
|
||||
jpeg_c_set_int_param(
|
||||
&context->cinfo, JINT_COMPRESS_PROFILE, JCP_FASTEST
|
||||
);
|
||||
}
|
||||
#endif
|
||||
jpeg_set_defaults(&context->cinfo);
|
||||
|
||||
/* Prevent RGB -> YCbCr conversion */
|
||||
|
|
Loading…
Reference in New Issue
Block a user