Added compile-time mozjpeg feature flag #8645
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #539
Pillow will currently detect and use MozJPEG if it is installed. However,
4.1.1 is not a libjpeg-turbo version. It is the MozJPEG version. So this PR detects MozJPEG, and updates the report to say 'compiled for mozjpeg 4.1.1'
I've also added
features.check_feature("mozjpeg")
Our current default behaviour is to not save progressive JPEGs, as documented in the saving keyword arguments at https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg-saving
However, mozjpeg does save progressive JPEGs by default, unlike libjpeg-turbo. If I change the 'compression profile' from 'best compression ratio (progressive, all mozjpeg extensions)' to 'libjpeg[-turbo] defaults (baseline, no mozjpeg extensions)', then after I relax some image comparison checks, our test suite passes.