[cairo] postscript image ascii encoding and compression

Alexander Larsson alexl at redhat.com
Thu Mar 2 07:37:02 PST 2006

On Wed, 2006-03-01 at 17:53 +0100, Alexander Larsson wrote:
> The current postscript backend output binary data for images. This means
> that I'm unable to print cairo-generated postscript on my printer. So, I
> implemented base85 encoding of the images in the postscript.
> While I was doing that I noticed that image compression was almost
> finished, but not quite hooked up, so I fixed that too.
> Patch against latest cvs attached.

Here is a new version of the patch that adds support code for LZW
compression and uses that. This means we're back to postscript level 2,
which is good for printing. Since I added base85 coding of image data I
also changed DocumentData to Clean7Bit. As far as I can tell there was
no other code that wrote binary data to the postscript file.

Here is the Changelog entry:

2006-03-02  Alexander Larsson  <alexl at redhat.com>

	* src/Makefile.am:
	Add cairo-lzw.c to sources
	Remove erronous space at start of line
	* src/cairo-lzw.c:
	New file implementing _cairo_compress_lzw which does Lempel-Ziv & Welch
	compression as used by postscript. Based on code from libtiff.
	* src/cairo-output-stream.c:
	Add _cairo_output_stream_write_base85_string which implements
	an encoder for the ASCII85Decode postscript filter.

	* src/cairoint.h:
	Add _cairo_compress_lzw and _cairo_output_stream_write_base85_string.
	* src/cairo-ps-surface.c:
	Write Images LZW + Base85 encoded.
	Change ps level to 2 (we only needed level 3 for FlateDecode).
	Change DocumentData to Clean7Bit as we don't include binary data

 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a lonely chivalrous photographer who hides his scarred face behind a 
mask. She's a wealthy blonde mechanic who don't take no shit from nobody. They 
fight crime! 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-ps-compressed-images-2.patch
Type: text/x-patch
Size: 21853 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060302/6222f27d/cairo-ps-compressed-images-2-0001.bin

More information about the cairo mailing list