cairo_surface_set_mime_data
François Bianco <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Organization | Université de Genève |
| Message-ID | <[email protected]> |
Hello, I am currently trying to fix a bug in the PDF export of Inkscape which is using the Cairo lib for that. The current exporter code convert JPG file to bitmaps which results in heavy PDF files. I'd like to store the image data with mime type in the PDF. Since it is my first use of Cairo, I started with a minimal example (attached). My example is working correctly, but it rises some questions to me: 1. Why is my code with 'cairo_image_surface_create' not displaying any image in the exported PDF ? as it does when creating a buggy image surface with 'cairo_image_surface_create_for_data' fed with raw JPG data ? (see lines with fixme in code) 2. In the Cairo documentation for 'cairo_surface_set_mime_data', it is stated "Caution: the associated MIME data will be discarded if you draw on the surface afterwards. Use this function with care. " Could one of you demonstrate (by changing my code) or explain me which cairo functions would cause a redraw of the surface which would finally results in loosing the MIME JPG data ? I ask that since I ported my example in Inkscape code, but the final output is always bitmaps. I am not able to locate which part of the code could cause this issue. I tried and implemented in my example a stupid rotation/scaling/translation to the image, but the surface is still perfectly exported with its jpg MIME data. Thanks you for your help, François Bianco -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo
testmime.tar.gz
(application/x-compressed-tar, 17 KB) - not displayed