Bug 116393

Summary: SuSEConfig.tetex cannot handle every resolution correctly
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Dennis Lubert <plasmahh>
Component: OtherAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: werner
Version: RC 1   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard: maint:released:11.2:28189
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Dennis Lubert 2005-09-11 14:36:07 UTC
The /sbin/conf.d/SuSEConfig.tetex script bails out here when the ${cur} variable
in line 144 contains something like "600x600x2" (The full lpoptions -l output
here is : "Resolution/Print Quality: 300x300dpi 600x600dpi *600x600x1dpi
600x600x2dpi") This causes the script to abort and not execute some of the other
things it needs to do, which sometimes is annoying ;)
Comment 1 Dr. Werner Fink 2005-09-12 09:56:08 UTC
Klaus?  Why does lpoptions reports such a resolution?
Comment 2 Klaus Singvogel 2005-09-12 10:01:33 UTC
Good question. But need myself more information to dig more easily into it: 
Dennis: which printer is configured at your machine? 
Please do (as root): grep ljet4 /etc/cups/ppd/* 
 
Comment 3 Klaus Singvogel 2005-09-12 10:05:46 UTC
Dennis: 
I scanned my whole /usr/share/cups/model directory and didn't find any such 
weird resolution. Is this a PPD file / printer driver, which comes with SUSE 
Linux? 
Comment 4 Johannes Meixner 2005-09-12 10:37:56 UTC
This is my bug because the broken resolution is in a PPD
of the manufactuere-PPDs package:
/usr/share/cups/model/manufacturer-PPDs/hp/HP_LaserJet_3200.ppd.gz

In fact this is of course a bug of HP because their PPD is broken:
The Adobe PPD specification section 5.9 reads:
-------------------------------------------------------------------------
... must be either a string of the form 300dpi or of the form 300x300dpi
or it can be Unknown
-------------------------------------------------------------------------

Werner, your script must be prepared to get the resolution
of the form [0-9][0-9]*dpi or [0-9][0-9]x[0-9][0-9]*dpi
or "Unknown". Nevertheless it is a good idea to fall back
to a fallback-resolution (e.g. 600dpi) if you cannot get
a valid resolution because the user can always install
whatever kind of PPD file (e.g. from the manufacturer's
driver CD for the printer) where I cannot fix it.
Comment 5 Johannes Meixner 2005-09-12 10:41:07 UTC
A typo: I meant "[0-9][0-9]*x[0-9][0-9]*dpi"
Comment 6 Dr. Werner Fink 2005-09-12 10:50:42 UTC
I'm now using 

   shopt -s extglob

   reg='?(\*)@(+([0-9])|+([0-9])x+([0-9]))dpi'

   case "$1" in
   $reg) cur=${1%%+([[:alpha:]])}
   esac
   cur="${cur#\*}"

   shopt -u extglob
Comment 7 Johannes Meixner 2005-09-12 11:01:50 UTC
New manufacturer-PPDs submitted right now to STABLE.
There "600x600x2dpi" was simply replaced by "600x1200dpi"
which is possible because "600x1200dpi" is not used elsewhere in the PPDs.
Comment 8 Johannes Meixner 2005-09-12 12:26:43 UTC
Same problem with HP's PPDs in the hplip package.
Submitted fixed hplip package right now to STABLE.
Comment 9 Dennis Lubert 2005-09-12 13:04:30 UTC
Ah, I did not realize that the Resolutions come directly from the installed
printer drivers. I have turboprint drivers installed to use advanced features
and resolutions of my printer, the /etc/cups/ppd/tp0.ppd looks like this in some
parts:
*DefaultResolution: 600x600x1dpi
*Resolution 300x300dpi/1 - 300dpi:
"<</turboprintResolution(300x300dpi)>>setpagedevice"
*Resolution 600x600dpi/2 - 600dpi:
"<</turboprintResolution(600x600dpi)>>setpagedevice"
*Resolution 600x600x1dpi/3 - 1200dpi:
"<</turboprintResolution(600x600x1dpi)>>setpagedevice"
*Resolution 600x600x2dpi/4 - 4800dpi:
"<</turboprintResolution(600x600x2dpi)>>setpagedevice"

I don't know if the SuSEConfig.tetex should know (and/or) calculate that it is
really 1200/4800, in case anyone else uses turboprint or other customized
resolutions...
Comment 10 Johannes Meixner 2005-09-12 13:15:36 UTC
Thanks for the comment!
This shows, that it really is not sufficient when I fixed the Suse
packages because you got them from elsewhere (see comment #4).
Comment 11 Swamp Workflow Management 2009-10-29 13:46:04 UTC
Update released for: hplip
Products:
openSUSE 11.2 (debug, i586, x86_64)