Comment 21 for bug 675936

Revision history for this message
Thomas (t-wolf-ch) wrote : Re: Some colors printed wrong (hpcups)

I just ran into the same bug. Again on a big-endian platform (Freescale QuoriQ e500v2; Linux Kernel 2.6.32.12, CUPS 1.5.4, hpcups 3.13.7). HP OfficeJet 4500 G510n-z (a pcl3gui2 printer) showed the same symptoms when printing from this platform.

The problem is indeed in Mode10.cpp, and Nenad's patch for this is spot-on.

Mode10 uses an endian-agnostic encoding of RGB as a single uint32_t. Using in Mode10::ShortDelta() the endian-dependent macros GetRed, GetGreen, GetBlue is therefore just wrong and fails on big-endian platforms. It works by chance on little-endian platforms because the Mode10 internal encoding corresponds to that.

Unfortunately I discovered this bug report here only after having spent considerable time to debug, track down, and fix this myself. I arrived at the exact same fix as Nenad.

The patch for CommonDefinitions.h is wrong, not needed, and should not be used. Other parts of the code depend on the macros being endian-dependent, in particular ErnieFilter.cpp.

I am a bit surprised that such a glaring bug with an obvious fix is still not fixed in the latest hpcups? (3.13.7 at this time)