Wrong color alignment for HP2600n, RHEL5 [solved; CUPS/foomatic problem]
Posted by: keithl ()
Date: February 07, 2010 03:46AM

I am using a clone of RHEL5, approximately the same as Fedora Core 6, and get a funny color Alignment offset. It uses CUPS 1.3.7 . I do not have the problem with Ubuntu Hardy, which also uses CUPS 1.3.7 .

I set the CUPS "printer options" Alignment Offset (Cyan, Magenta, Yellow) to all 0, and print a test page. The colors are offset by -100 lines, downwards. If I set the offsets to +2 or -2, the offsets are small. The numbers stored in the /etc/cups/ppd/myprinter.ppd file look OK.

As a test, I hacked the /usr/bin/foo2hp2600-wrapper file for a quick-and-dirty fix:

BEFORE

| foo2hp -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
            $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
            -O$OFF_C,$OFF_M,$OFF_Y,$OFF_K -J "$LPJOB" -U "$USER" \
            $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG

AFTER

| foo2hp -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
            $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
            -O0,0,0,0 -J "$LPJOB" -U "$USER" \
            $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG


That got rid of the offset. I'm not much of a programmer, but I suspect that RHEL5 adds a different number of spaces the arguments, and the substr function in the options processing code is clipping the option lines wrong, for example:

          c=*|C=*) OFF_C=`expr substr $OPTARG 3 99`;;


... or the expr is not handling the zero numeral correctly. I'm guessing that a regular expression should be used instead of a substring, but I will leave that to the folks that know what they are doing. For now, I'll just use the hack (I don't need to offset colors) until something better comes along. Ideas? Suggested other tests?



Edited 1 time(s). Last edit at 02/07/2010 04:10PM by rickrich.

Re: Wrong color alignment for HP2600n, RHEL5
Posted by: rickrich ()
Date: February 07, 2010 06:29AM

Please download, make, make install, and run your tests. Please Post:

$ grep foo2hp /var/log/messages

Re: Wrong color alignment for HP2600n, RHEL5
Posted by: keithl ()
Date: February 07, 2010 03:23PM

Good idea - it did not occur to me to check /var/log/messages. I downloaded again, remade and installed it. It looks the same as what I downloaded yesterday, with the same results:

> grep foo2hp /var/log/messages

Feb  7 11:52:57 kao foo2hp2600-wrapper: foo2hp2600-wrapper -z0 -c -b1 -p1 -s7 -m1 -d1 -n1 -Oc=-100 -Om=-100 -Oy=-100 -Gdefault
Feb  7 11:52:57 kao foo2hp2600-wrapper: foo2zjs-icc2ps -o /usr/share/foo2hp/icm/hpclj2600n-1.icm -t0 > /tmp/icc6579.crd.ps
Feb  7 11:53:00 kao foo2hp2600-wrapper: gs -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk -dCOLORSCREEN  /tmp/icc6579.usecie.ps /tmp/icc6579.crd.ps /tmp/icc6579.selcrd.ps
Feb  7 11:53:00 kao foo2hp2600-wrapper: foo2hp -r600x600 -g5100x6600 -p1 -m1 -n1 -d1 -s7 -c -b1 -u 86x80 -l 86x80   -O-100,-100,-100,0 -B -A


I put a copy of those lines, and of my ppd file, on my wiki

Re: Wrong color alignment for HP2600n, RHEL5
Posted by: keithl ()
Date: February 07, 2010 03:53PM

Looking at /usr/bin/foo2hp2600-wrapper , it looks like the first message line is just a replay of the arguments given to the shell script. I assume that is a foomatic error. I don't understand foomatic. I am using the standard RHEL5 foomatic from the version 3.0.2-38.3.el5 RPM. If that is what needs fixing, I am tempted to build a simplified HP-Color_LaserJet_2600n.ppd.gz file that leaves out those arguments. I can get all the color offsets I need from chromatic aberration in cheap eyeglasses ;-)

But I assume a Real Programmer (tm) can suggest a cleaner way. I hesitate to rebuild foomatic itself, it might get "restored" to pristine broken condition by automated updates, and it looks a lot more complicated than the well-written foo2zjs family of drivers.

Re: Wrong color alignment for HP2600n, RHEL5
Posted by: rickrich ()
Date: February 07, 2010 04:09PM

It is a CUPS/foomatic problem, not a foo2zjs problem. I would delete the printer and create it again. Otherwise, I would file a Bug Report with
Redhat Bugzillia.



Edited 1 time(s). Last edit at 02/07/2010 04:12PM by rickrich.

Re: Wrong color alignment for HP2600n, RHEL5
Posted by: keithl ()
Date: February 07, 2010 11:22PM

The same CUPS version is used on both the working Ubuntu system and the misaligned RHEL5 system. The foomatic versions differ. Again, I don't want to mess with foomatic; distro updates will just write over it.

The easiest thing was to make a simplified version of the PPD file. I copied /usr/share/cups/model/HP-Color_LaserJet_2600n.ppd.gz to /usr/share/cups/model/HP2600n_khl.ppd.gz
, available on my wiki: HP2600n_khl.ppd.gz ). I deleted all the lines starting with
*OpenGroup: Alignment (in rows)/Alignment (in rows)
and ending with
*CloseGroup: Alignment (in rows)
I then used the CUPS administration page to change the driver PPD. That simplifies the configuration of Printer Options, too. Updates of foo2hp will overwrite the original PPD file, but leave the modified copy alone, so that keeps me on the upgrade path.

Re: Wrong color alignment for HP2600n, RHEL5 [solved; CUPS/foomatic problem]
Posted by: rickrich ()
Date: February 07, 2010 11:59PM

Sorry, you should file a BUG REPORT, not a workaround. Bug Reports help all people who use that distro. A workaround only helps you.

Sorry, only registered users may post in this forum.
This forum powered by Phorum.