[cairo] JPEG Support For Libcairo

Bernhard Fischer bf at abenteuerland.at
Tue Dec 29 02:55:35 PST 2015

On Tuesday 29 December 2015 09:57:25 Adrian Johnson wrote:
> On 29/12/15 00:42, Bernhard Fischer wrote:
> > I implemented two small functions which read/write JPEG into/from a Cairo
> > image surface.
> > 
> > Please find more info here:
> > https://www.cypherpunk.at/2015/12/jpeg-support-for-libcairo/
> > 
> > 
> > Best regards,
> > Bernhard
> If you are going to use this code with any of the PDF/PS/SVG/Win32Print
> backends it is a good idea to set the JPEG mime data for the image
> surface. That way JPEG files will be embedded directly in the output
> instead of the backend compressing the image data with lossless
> compression. See attached patch.

I updated the code but modified it in order to avoid the duplicate data loading 
(which occurs in your patch) and I added error checking to malloc().

Latest code here:


More information about the cairo mailing list