[cairo] Re: Embeding JPG in PDF

Andrew McRae amcrae at employees.org
Wed Jan 10 15:07:04 PST 2007


On Tue, 2007-01-09 at 17:08 -0800, Stuart Parmenter wrote:
> Please don't add more formats to cairo.  Even adding one more is going
> to mean that someone will want yet another image format.  It is
> trivial to do external loading of jpegs and to put them in to
> surfaces.  Loading images just shouldn't be something cairo is in the
> business of doing.

Whilst loading images may not be that useful, perhaps saving them
in various formats may be useful. Also, having some
selectable parameters for the saving is useful e.g for PNG, having
the option for paletted images. I have patches to support
both JPEG and GIF, and was thinking about contributing the JPEG
support back. It's a compile time option, and if you don't want it,
don't build it. I also have quantization code (octree based)
to generate paletted PNG images.

I agree that avoiding a proliferation of image formats is a good thing,
but it would appear supporting a sweet spot of the most common
formats is a good thing. Should this include jpeg? IMHO, yes...

> As for the actual topic this thread was started for...  I'm not sure
> that you really ever want to lose image quality when printing images
> do you?  I think adding stuff to cairo-pdf.h as Behdad suggest is
> probably the best way to go.

Getting higher resolution images into the PDF side has been
brought up before - my previous patch to allow fallback
resolution to be used for PDF image resolution was rejected,
but I still don't see how the alternatives can give you better
than 72 dpi images in PDF?
Cheers,
AMc



More information about the cairo mailing list