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

Scan made from ADF are corrupted #413

Closed
manuc66 opened this issue Feb 11, 2022 · 10 comments · Fixed by #456
Closed

Scan made from ADF are corrupted #413

manuc66 opened this issue Feb 11, 2022 · 10 comments · Fixed by #456
Labels

Comments

@manuc66
Copy link
Owner

manuc66 commented Feb 11, 2022

The scan from ADF (Automatic Document feed) are corrupted, images are corrupted and can't be viewed

Sample corrupted image : scanPage1

If I open it in some software, it says that : Maximum supported image dimension is 65500 pixels

@rouvenst
Copy link

rouvenst commented Mar 7, 2022

Just used the latest docker image and confirm the corrupted files when scanning via ADF. Scanning with flatbed works.
I'm using the HP OfficeJet 5740.

The Image file of one A4 page has dimensions of 1654 × 65535.
No errors in logs can be found.

_node-hp-scan-to_logs.txt

scan_07 03 2022_12:34:43

@superflo22
Copy link

Tested on my HP OfficeJet 6500A, same issue there.

@autumnwalker
Copy link

Seeing the same issue here. Are issue #428 and #413 related?

@manuc66
Copy link
Owner Author

manuc66 commented Apr 13, 2022

Seeing the same issue here. Are issue #428 and #413 related?

@autumnwalker No I don't think it's the same issue

@BrendanErquiaga
Copy link

Seeing the same issue on my HP OfficeJet Pro 8025e

@manuc66
Copy link
Owner Author

manuc66 commented May 2, 2022

The binary stream that is downloaded from the device is not corrupted during transfer.

If I use this online service, the document content can be revealed, but the height of the image is not accurate : https://jpg.repair/fix-picture.php?uid=626f9a48c4c1d4.00253158

@manuc66
Copy link
Owner Author

manuc66 commented May 2, 2022

If I set the image dimension inside the JPEG stream inside the header, the picture can then be opened

I'm going to implement that fix.

@manuc66
Copy link
Owner Author

manuc66 commented May 2, 2022

It's not enough to fully fix it, there is now a pink banner at the bottom of each page (see #455)

@manuc66
Copy link
Owner Author

manuc66 commented May 3, 2022

I've analyzed the image on which size has been overridden with this online tool https://processing.compress-or-die.com/analyze-process, and it states that the file contains a DNL marker.

The JPEG standard allows DNL markers to appear with compressed data. A DNL marker is used to define or redefine the image size within the compressed data rather than within the SOFn marker. In prac-tice DNL markers are not used and most applications cannot handle them. Therefore, we will not con-sider them further.
https://123dok.net/article/jpeg-file-format-file-formats.y96jd0lr

@manuc66
Copy link
Owner Author

manuc66 commented May 4, 2022

The scan is fixed by defining inside the jpeg stream the height of the document that can be found in the stream after the DNL marker

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 a pull request may close this issue.

5 participants