-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Add a new parameter to JpegImage.getData
to indicate the source of the image data (issue 9513)
#10031
Conversation
…n a regular function Given how `_isColorConversionNeeded` is used, and that it always returns a boolean value, having it be a getter seems more appropriate.
…the image data (issue 9513) The purpose of this patch is to provide a better default behaviour when `JpegImage` is used to parse standalone JPEG images with CMYK colour spaces. Since the issue that the patch concerns is somewhat of a special-case, the implementation utilizes the already existing decode support in an attempt to minimize the impact w.r.t. code size. *Please note:* It's always possible for the user of `JpegImage` to control image inversion, and thus override the new behaviour, by simply passing a custom `decodeTransform` array upon initialization.
83c1fa3
to
663922f
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/17904e3f46fed8a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/7c259a2bca89e2b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/17904e3f46fed8a/output.txt Total script time: 19.41 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/7c259a2bca89e2b/output.txt Total script time: 24.58 mins
|
I have enough confidence in this solution because it doesn't modify the normal behavior (no test failures), is well documented in the comments with a reference to the original issue and is easy in terms of code. Thank you for helping out with this! |
I have a related question. I want to let users extract JPG out of a PDF file. Is it possible to build the "isSourcePDF" parameter into a binary JPG, without having to decompress it and compress it again? Maybe just change a few bytes in some metadata? |
The purpose of this patch is to provide a better default behaviour when
JpegImage
is used to parse standalone JPEG images with CMYK colour spaces.Since the issue that the patch concerns is somewhat of a special-case, the implementation utilizes the already existing decode support in an attempt to minimize the impact w.r.t. code size.
Please note: It's always possible for the user of
JpegImage
to control image inversion, and thus override the new behaviour, by simply passing a customdecodeTransform
array upon initialization.Edit: I should probably add that all of this feels hand-wavy, at least to me, as far as solutions go...