News for hackers. Stuff that matters.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by noisy_boy on Monday November 15, 2021 @01:28AM (#29224405)
> This is not an OCR problem (as we switched off OCR on purpose), it is a lot worse – patches of the pixel data are randomly replaced in a very subtle and dangerous way: The scanned images look correct at first glance, even though numbers may actually be incorrect.

I have a habit of scanning invoices/statements/manuals etc to pdf and found the above quite alarming. Though I don't use Xerox (my scanner is Epson Perfection V39), I never considered the possibility that a scan of a document can result in altered numbers. How do I know if my scanner could also be affected in case it uses similar underlying software/setup?

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by dinkelberg on Monday November 15, 2021 @04:02AM (#29225275)
You should be safe if your scanner uses either JPEG, lossless JBIG2 or other lossless compression.

If however it uses lossy JBIG2 compression, it is quite possible that it suffers from the same problem, due to how lossy JBIG2 compression works.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by dreamcompiler on Monday November 15, 2021 @09:47AM (#29227999)
TFA suggests that Xerox was offering the option of lossless JBIG2 compression but they implemented it incorrectly -- they didn't include the delta blocks that described how individual image blocks differed from canonical patterns.

Which brings up another point: How did Xerox's SW development process take place? Was it done in-house with frequent code reviews or was it outsourced to a low bidder and then thrown back over the wall with no real quality assurance process?

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by kevinpet on Monday November 15, 2021 @01:09PM (#29230451)
This isn't the kind of issue a code review would catch. Code review will find when the code isn't written to standards or doesn't look maintainable. It isn't going to catch a subtle misuse of a technique that should be valid.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by kragen on Tuesday November 16, 2021 @02:25AM (#29237844)
That depends on what kind of code review you're doing. Code reviews intended to find bugs are very good at finding bugs that would be hard to find by testing.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by flatiron on Monday November 15, 2021 @01:56PM (#29231105)
the review should also be reviewing the tests, and you should really have a test if you have a standard.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by tablespoon on Monday November 15, 2021 @03:00PM (#29231925)
> the review should also be reviewing the tests, and you should really have a test if you have a standard.

Codes reviews and unit tests aren't a substitute for QA or acceptance testing. It's great when code reviews do catch stuff like this, but that's not going to catch everything. To me this bug points to deficiencies in another part of the process.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by mypalmike on Tuesday November 16, 2021 @01:57AM (#29237701)
One would have to know about this failure mode to write a test for it. Would you think to write this particular test?
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by flatiron on Tuesday November 16, 2021 @07:22AM (#29239696)
I know nothing about this encoding but I would think each implementable feature of the standard should have some tests that you can implement. Maybe some sample data and then process it’s encoded counter part. I bet I am trivializing it but I would hope they are thinking twice about shoring up their process.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by zelon88 on Tuesday November 16, 2021 @12:50AM (#29237344)
Who scans documents as JPEG, though?

PDF is widely more common and there are a million different ways you can write them. Including with JBIG2 images.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by dinkelberg on Tuesday November 16, 2021 @01:51AM (#29237660)
PDF files are often made up of JPEGs internally.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by superjan on Monday November 15, 2021 @01:56AM (#29224569)
If you scan in color/grayscale, it can’t use JBIG2 compression. The machine will likely use JPEG for lossy compression, could result in less crisp scans, but it eliminates this risk.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by askl on Monday November 15, 2021 @03:05AM (#29224943)
Or you could use JBIG2 with reasonable settings.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by colinfinck on Monday November 15, 2021 @03:40AM (#29225142)
From the original post: "numbers seem to be mangled independently from the compression mode, which makes the issue hard to avoid"
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by dinkelberg on Monday November 15, 2021 @11:05AM (#29228964)
What the author refers to are the three available compression modes on Xerox scanners, which are "normal", "higher", and "highest". It is not clear what that means exactly, but it is possible that all three of those are lossy compression modes.

In my opinion, the only reasonable mode for JBIG2 is lossless, as the lossy mode of JBIG2 is, in general, prone to these character mangling issues. File sizes for lossless JBIG2 compression are already very low, so I would claim that using lossless is almost always worth it, unless character mangling is explicitly not a problem.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by ace2358 on Monday November 15, 2021 @04:09AM (#29225329)
Reasonable settings meaning no compression setting which was mentioned to not have the issue
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by texasbigdata on Monday November 15, 2021 @05:05AM (#29225694)
Thanks would love a 45mb one page PDF
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by bryanrasmussen on Monday November 15, 2021 @05:45AM (#29225895)
I would love not to send a scanned document with different numbers to my accountant, or to the IRS for that matter.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by m3at on Monday November 15, 2021 @05:12AM (#29225722)
The author was using default settings, I think it's fair to call the defaults reasonable
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by abrichr on Monday November 15, 2021 @01:42AM (#29224486)
From the article:

> In the next section, there is a a short manual for you to reproduce the error and see of you are affected.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by zoomablemind on Monday November 15, 2021 @08:54AM (#29227367)
I wonder if this may be also a problem with Samsung MFPs, as some Xerox consumer models were apparently OEM'd by Samsung (e.g. Samsung SCX-4200 vs. Xerox 3119, or was it the other way around?). Not sure if there's a list which links the Xerox-Samsung similar models.

I guess, if the scanner offers JBIG2 format option, it may need a test at least.

Re:Xerox scanners/photocopiers randomly alter numbers in sca... by TomMasz on Monday November 15, 2021 @10:11AM (#29228302)
Xerox purchased a number of small desktop and larger machines from Samsung, including the one you mention.
Re:Xerox scanners/photocopiers randomly alter numbers in sca... by andi999 on Monday November 15, 2021 @05:33AM (#29225834)
Keep the originals.