Bug 24805 - duplicated XObjects with subtype image in PDF Output
Summary: duplicated XObjects with subtype image in PDF Output
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 1.10.0
Hardware: Other All
: medium major
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
Depends on:
Reported: 2009-10-29 20:16 UTC by clark
Modified: 2010-11-22 05:53 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Description clark 2009-10-29 20:16:45 UTC
Last time I logged one issue for duplicated XObjects with subtype image by Cairo 1.8.8.Chris advised me to use the new version of Cairo 1.9.4, which should address this problem.

I just use the Cairo 1.9.4 to generate the pdf output. After I did a simple test and went tthrough the cairo output, I still found many dulplicated objects.

Take object 213 and 216 in the attachment for example. They are duplicated with each object.Can anyone take a look whether we can eliminate the redudant objects.
Comment 1 Carlos Garcia Campos 2010-09-08 03:19:21 UTC
It seems we are using the unique id of the image surface as the hash key for the surfaces cache, however it's possible to add the same image multiple times using different cairo surfaces. We would need to use the image contents (or even better the mime data if it exists) to make sure we don't duplicate image xobjects.
Comment 2 Adrian Johnson 2010-11-22 05:53:36 UTC
Fix in git master


A new mime type CAIRO_MIME_TYPE_UNIQUE_ID has been added. Surfaces with the same unique id will only be embedded once even if different surfaces are created. We've offloaded the job of identifying different surfaces with the same content to the application. You can put what ever you want in the UNIQUE_ID to uniquely identify the surface. eg a filename or SHA1 hash.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.