Closed Bug 129655 Opened 22 years ago Closed 22 years ago

[ps] PostScript module device depth is 1bit

Categories

(Core :: Printing: Output, defect)

All
Linux
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: roland.mainz, Assigned: roland.mainz)

References

()

Details

Attachments

(1 file)

I found a longstanding issue in the PostScript module:
The device depth is always 1bit instead of 24bit(8bit per R,G,B) - this may
screw-up some things...
Fix in bug 119491 ...
Status: NEW → ASSIGNED
Depends on: 119491
Target Milestone: --- → mozilla1.0
Moved the fix into bug 126799 ...
Depends on: 126799
No longer depends on: 119491
No longer depends on: 126799
Depends on: 126799
I would like to make a couple comments.

1.)  I would like the patch for this bug.. to be placed by itself in this bug,
not as part of another patch.  Its a better way to keep track of this issue, and
what was done to solve this issue.

2.)  If you would like.. I would like to fix this bug, because I dont fully
understand what it means to set the depth to something besides 1 bit deep for
postscript.   Printers are mostly 1 bit deep.. and even if you have a printer
that is not.. I dont know how this parameter would effect that output.  I think
that paremater is more something used for buffers, calculating row distances,
memory, etc, I dont really know how postscript is using that at this moment.

3.)  If you do fix this.. I would require that I review this.. I am the owner of
the postscript stuff and I want to make sure we dont have any unessisary
regressions, or at least I want to keep track of this issues that effect postscript.

4.) What is your take on the depth, and how do you think the PS module should
use it, and what things are you talking about that may get screwed up.
dcone@netscape.com wrote:
 
> I would like to make a couple comments.
> 
> 1.)  I would like the patch for this bug.. to be placed by itself in this bug,
> not as part of another patch.  Its a better way to keep track of this issue, 

;-((
OK, I'll take the "fix" (=one line) out of bug 126799...

> and what was done to solve this issue.

The fix is to change "depth = 1" to "depth = 24" - that's all.

> 2.)  If you would like.. I would like to fix this bug, because I dont fully
> understand what it means to set the depth to something besides 1 bit deep for
> postscript.   Printers are mostly 1 bit deep.. and even if you have a printer
> that is not.. I dont know how this parameter would effect that output.  I 
> think that paremater is more something used for buffers, calculating row 
> distances, memory, etc, I dont really know how postscript is using that at 
> this moment.

The (future) problem will be SVG - our ScaleableVectorGraphics support.
Currently it simply crashes cause it lacks support for 1bit devices (actually
the PostScript module code itself assumes that it is fed with 24bit RGB data but
annouces itself that it is a 1bit device...)...

> 3.)  If you do fix this.. I would require that I review this.. I am the owner
> of > the postscript stuff and I want to make sure we dont have any unessisary
> regressions, or at least I want to keep track of this issues that effect 
> postscript.

Sure.

> 4.) What is your take on the depth, and how do you think the PS module should
> use it, and what things are you talking about that may get screwed up.

See above. Code which looks at the device depth and adjust itself based on that 
value will go nuts (like our SVG code) ...
No longer depends on: 126799
dcone - can you r= the patch, please ?
Keywords: patch, review
Comment on attachment 76061 [details] [diff] [review]
Patch for 2002-03-23-08-trunk

sr=attinasi (aaahhh, nice and easy)
Attachment #76061 - Flags: superreview+
are we always 24 bit.. what about on black and white printers.. are we 8 bit 
deep there, since its indexed?
dcone wrote:
> are we always 24 bit.. what about on black and white printers.. are we 8 bit 
> deep there, since its indexed?

The data returned by |GetDepth()| is the depth we accept, not the depth we
output. nsDeviceContextPS always wants 24bit RGB as input.
r=dcone.  
I dont think at this time its bad to have 24 bit returned.. but I think its 
important to keep discussing how to use this depth correctly.
The Depth is what is supported by the Device represented by the DeviceContext.  
So for example if a routine asked for the depth of the device, that routine can 
use a depth for a "blend" that is appropriate for that device.  So my question 
.. is 24 bit always appropriate, or are there times it should be 8 bit, or even 
1 bit.  If we are going to output an image that is optimized for a printer, let 
say and 8 bit color indexed printer... I think that 8 bit should be returned so 
a pallete could be optimized so and optimized halftone of that output image 
could be generated.  If we had a super duper color photo printer 24 bit would be 
appropriate.  Or if we had a black and white printer, a depth of 1 bit would be 
important so we could do a halftone thats better than the ordered dither used by 
postscript.  
Comment on attachment 76061 [details] [diff] [review]
Patch for 2002-03-23-08-trunk

r=dcone
Attachment #76061 - Flags: review+
dcone:
Mozilla does not have any special support for 8bit/1bit displays. For example on
Linux/Unix we use the GDK/GTK+ libraries which only offer a static, hardcoded
palette (which is very worse compared to what NS4.x can do with it's dynamic
palette change code, but those people do not care about palette displays
anyway... ;-( ) and is fed with 24bit RGB data.
Same applies to the PostScript module... the current code always expects 24bit
RGB data - feeding anything else just causes a crash... ;-(
but the DeviceContext is a virtual device.. so it supports what we say.  If GTK 
supports only a limited number of colors.. it handles that.  Postscript is not 
limited to GTK.  For example.. I might want to output PostScript on a device 
that is a high end printer.. then 24 bit is appropriate.. if I wanted to do 
advanced halftones.. 1 bit or 8 bit is appropriate.... it tells the nsImage that  
we have certain capabilites in this DeviceContext.  I think its a mistake to 
limit how this is used.. and better to use this to reflect the true depth of a 
device.. its representing.
dcone:
OT: Does PostScript Level 2 (or level 3) support 8bit palette-indexed images ?
Patch checked in
(http://bonsai.mozilla.org/cvsquery.cgi?module=MozillaTinderboxAll&branch=HEAD&cvsroot=/cvsroot&date=explicit&mindate=1019824680&maxdate=1019825760&who=peterv%25netscape.com),
marking bug as FIXED.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Roland please verify...thanks..
Verifying, seems to "work" now... :)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: