-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Update JpegImage.getData
to support forceRGBoutput
for images with numComponents === 1
(issue 6066)
#6984
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/03c240f23393c15/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/b4e0a3d7f37e8f5/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/03c240f23393c15/output.txt Total script time: 20.40 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/b4e0a3d7f37e8f5/output.txt Total script time: 21.61 mins
Image differences available at: http://107.21.233.14:8877/b4e0a3d7f37e8f5/reftest-analyzer.html#web=eq.log |
/botio-linux test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1a01196acabbb20/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/1a01196acabbb20/output.txt Total script time: 21.82 mins
|
Something that may be worth exploring is always using jpg.js. In a few basic tests I did it was actually faster to not use the browser to decode images. |
Yes, it could be interesting to compare the performance! |
What about fixing JpegImage.getData() for numComponents === 1 and forceRGB = true? |
"md5": "b26eb08fc5ab2518ba8fde603bdfc46b", | ||
"rounds": 1, | ||
"link": true, | ||
"firstPage": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to run both pages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I've changed this in the new patch.
PDFImage_createImageData
for unmasked JPEG images with DeviceGray
ColorSpacesJpegImage.getData
to support forceRGBoutput
for images with numComponents === 1
(issue 6066)
Is the new patch more in line with what you had in mind here? /botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/5fffab191b05d6e/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/47c51abae870185/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/5fffab191b05d6e/output.txt Total script time: 20.37 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/47c51abae870185/output.txt Total script time: 21.57 mins
|
var rgbData = new Uint8Array(width * height * 3); | ||
var offset = 0; | ||
for (var i = 0, ii = data.length; i < ii; i++) { | ||
rgbData[offset++] = data[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the jit is smart enough to realize it's accessing the same data[i] here. Best to probably stick it in a variable within the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in the new commit.
Yup, looks good with one nit fixed above. |
…h `numComponents === 1` (issue 6066) *A more robust solution for issue 6066.* As a temporary work-around for (the upstream) [bug 1164199](https://bugzilla.mozilla.org/show_bug.cgi?id=1164199), we parsed *all* images in the Firefox addon during a short time. Doing so uncovered an issue with our image handling (see 6066), for JPEG images with a `DeviceGray` ColorSpace *and* `bpc !== 1` (bits per component). As long as we let the browser handle image decoding in this case, this isn't going to be an issue, but I do think that we should proactively fix this to avoid future issues if we change where the images are decoded (in `jpg.js` vs in browser). Also, we currently don't seem to have a test-case for that kind of image data.
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/93201b0394df9e3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/dcd4ec06dce6ea6/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/dcd4ec06dce6ea6/output.txt Total script time: 20.25 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/93201b0394df9e3/output.txt Total script time: 21.81 mins
|
I'm assuming that this means r+, so having addressed the nit, I'm going to land this. /botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/32831967815e323/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/fd574f523d316c9/output.txt |
Update `JpegImage.getData` to support `forceRGBoutput` for images with `numComponents === 1` (issue 6066)
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/fd574f523d316c9/output.txt Total script time: 19.99 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/32831967815e323/output.txt Total script time: 21.00 mins
|
A more robust solution for issue #6066.
As a temporary work-around for (the upstream) bug 1164199, we parsed all images in the Firefox addon during a short time.
Doing so uncovered an issue with our image handling (see #6066), for JPEG images with a
DeviceGray
ColorSpace andbpc !== 1
(bits per component).As long as we let the browser handle image decoding in this case, this isn't going to be an issue, but I do think that we should proactively fix this to avoid future issues if we change where the images are decoded (in
jpg.js
vs in browser).Also, we currently don't seem to have a test-case for that kind of image data.