Repository navigation
FIX Include the output settings in the ImageCompressionConverter identifier - #3365
Merged
Roman Lutz (romanlutz) merged 3 commits intoOct 20, 2026
Conversation
Roman Lutz (romanlutz)
approved these changes
Oct 20, 2026
Roman Lutz (romanlutz)
left a comment
Contributor
There was a problem hiding this comment.
looks great! I will make a tiny change and otherwise it's ready to merge.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 11737ed7-7291-4e15-b8d5-b379f3a64ac4
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 11737ed7-7291-4e15-b8d5-b379f3a64ac4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Follow-up to #3245, which fixed the same identifier gap for
QRCodeConverterandPDFConverterand namedImageCompressionConverteras the remaining case.ImageCompressionConverter._build_identifier()includes the output format, quality, compress level, lossless and method, but omits three settings that change the produced image or the conversion outcome:background_colorfills transparent pixels when the output mode has no alpha channel.min_compression_thresholddecides whether a smaller compressed candidate is kept.fallback_to_originaldecides whether an unsuccessful compression returns the original bytes.Two converters that differ only in these settings therefore share
get_identifier().hashand the default registry name. Registering the second one raisesValueError: Instance 'ImageCompressionConverter::...' already exists, and a lookup by that name returns the wrong instance. The three settings are now part of the identifier params. Defaults are unchanged, so the default hash stays the same.Tests and Documentation
Added tests in
tests/unit/converter/test_image_compression_converter.py:Local runs (
PYTHONPATH=. python -m pytest -p no:opik -p no:ddtrace):tests/unit/converter/test_image_compression_converter.py: 32 passed.main(71a01b3), the three distinction cases and the identifier-params test fail because the hashes collide; the equal-settings test passes. With this change all four pass.ruff checkandruff format --checkpass on both changed files.No documentation pages change, so no JupyText run was needed.