Re: [Gnome-print] Can't print TIFF file from GdkPixbuf?



Hello!

On 22 Apr 2001 18:00:00 -0400, Scott Gifford wrote:
> I've got some code I'm working on printing fine from .pnm files, but
> for some reason it won't work for .tiff files.  It prints them, but
> they look horrible; the text contained in the images is blocky and
> unreadable.

Your tiff file contains alpha channel. As plain PostScript does not
support transparency, images with alpha are rendered to temporary
buffer, whose resolution is currently hardcoded to 72dpi. That buffer
is then rendered to resultiong PostScript stream.
I do not know, whether gdk_pixbuf treats all tiff-s as 32bit images
(with alpha), or is there some possibility force it to use 8 or 24
bits per pixel. I bet you do not need alpha for your image, but
unfortunately there is no way for gnome-print to know that, if
supplied gdk_pixbuf uses alpha ;(
If you need image format with good non-lossy compression that is well
supported by gdk_pixbuf (including 8 and 24 bpp), you can use png. I do
not know much about other formats unfortunately...

Best wishes,
Lauris Kaplinski

> 
> I've written a simplified test case program, which demonstrates both
> the problem with TIFF files, and the non-problem with PNM files.
> 
> I've attached the program, since it's only 38 lines long.  It can be
> compiled with:
> 
>     gcc `gnome-config --cflags --libs print` tiffprint.c -o tiffprint
> 
> It can be run with
> 
>     ./tiffprint filename.tiff
>     ./tiffprint filename.pnm
> 
> The TIFF and PNM files are both generated with GhostScript:
> 
>   gs -dNOPAUSE -dBATCH -r300 -sDEVICE=tiffg32d -sOutputFile=/tmp/test.%d.tiff 1040rpg1.pdf
>   gs -dNOPAUSE -dBATCH -r300 -sDEVICE=pnm -sOutputFile=/tmp/test.%d.tiff 1040rpg1.pnm
> 
> Both of these images can be viewed on the screen in ee, and in my own
> program, which uses a GnomePixbuf to display it.
> 
> Any ideas?
> 
> Thanks,
> 
> -----ScottG.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]