Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compile-time mozjpeg feature flag #8645

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Dec 31, 2024

Resolves #539

Pillow will currently detect and use MozJPEG if it is installed. However,

  1. Pillow will report

--- JPEG support ok, compiled for libjpeg-turbo 4.1.1

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")

  1. Testing in Ubuntu on GitHub Actions, there are currently 12 test failures.

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

progressive
If present and true, indicates that this image should be stored as a progressive JPEG file.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility with mozjpeg
1 participant