Bug 9983 - Cairo repeats image pattern in PDF output
Summary: Cairo repeats image pattern in PDF output
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 1.3.14
Hardware: Other All
: medium blocker
Assignee: Kristian Høgsberg
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-15 06:24 UTC by Mathias Hasselmann
Modified: 2007-03-02 04:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Output of the PDF backend. (65.95 KB, image/png)
2007-02-15 06:25 UTC, Mathias Hasselmann
Details
Output of the PS backend. (68.72 KB, image/png)
2007-02-15 06:25 UTC, Mathias Hasselmann
Details
Primitive test image (8.47 KB, image/png)
2007-02-15 08:39 UTC, Mathias Hasselmann
Details
Minimal test case (2.76 KB, text/x-csrc)
2007-02-15 08:52 UTC, Mathias Hasselmann
Details
Correct output of the image backend for the testcase. (3.46 KB, image/png)
2007-02-15 08:53 UTC, Mathias Hasselmann
Details
Correct output of the Postscript backend for the testcase. (158.78 KB, application/postscript)
2007-02-15 08:54 UTC, Mathias Hasselmann
Details
Incorrect output of the PDF backend for the testcase. (33.61 KB, application/pdf)
2007-02-15 08:55 UTC, Mathias Hasselmann
Details
Correct output showing things are working in 1.3.15 (33.61 KB, application/octet-stream)
2007-03-02 04:00 UTC, Carl Worth
Details

Description Mathias Hasselmann 2007-02-15 06:24:20 UTC
The PDF backend still has some problems with images used as pattern. The image and the PS backend render correctly.
Comment 1 Mathias Hasselmann 2007-02-15 06:25:09 UTC
Created attachment 8712 [details]
Output of the PDF backend.
Comment 2 Mathias Hasselmann 2007-02-15 06:25:41 UTC
Created attachment 8713 [details]
Output of the PS backend.
Comment 3 Mathias Hasselmann 2007-02-15 06:30:37 UTC
Forgot to mention how I render and how I create the pattern:

pattern creation:

            pixbuf_swap_red_and_blue(image->pixbuf);

            image->surface = cairo_image_surface_create_for_data(
                gdk_pixbuf_get_pixels(image->pixbuf), CAIRO_FORMAT_ARGB32,
                gdk_pixbuf_get_width(image->pixbuf), gdk_pixbuf_get_height(image->pixbuf),
                gdk_pixbuf_get_rowstride(image->pixbuf));

            image->pattern = cairo_pattern_create_for_surface(image->surface);
            cairo_pattern_set_extend(image->pattern, CAIRO_EXTEND_NONE);
            cairo_pattern_set_filter(image->pattern, CAIRO_FILTER_BEST);


rendering sequence for the image:

        cairo_save(cr);

        cairo_translate(cr, width/2, height/2);
        cairo_rotate(cr, M_PI * image->orientation/180);

        cairo_scale(cr, sx, sy);
        cairo_translate(cr, ix, iy);
        cairo_set_source(cr, image->pattern);

        if (image->opacity < 1.0) {
            cairo_paint_with_alpha(cr, image->opacity);
        } else {
            cairo_paint(cr);
        }

        cairo_restore(cr);
Comment 4 Mathias Hasselmann 2007-02-15 08:39:17 UTC
Created attachment 8721 [details]
Primitive test image
Comment 5 Mathias Hasselmann 2007-02-15 08:52:58 UTC
Created attachment 8723 [details]
Minimal test case
Comment 6 Mathias Hasselmann 2007-02-15 08:53:50 UTC
Created attachment 8724 [details]
Correct output of the image backend for the testcase.
Comment 7 Mathias Hasselmann 2007-02-15 08:54:26 UTC
Created attachment 8725 [details]
Correct output of the Postscript backend for the testcase.
Comment 8 Mathias Hasselmann 2007-02-15 08:55:00 UTC
Created attachment 8726 [details]
Incorrect output of the PDF backend for the testcase.
Comment 9 Behdad Esfahbod 2007-02-15 19:09:12 UTC
Carl, isn't this supposed to be fixed?
Comment 10 Carl Worth 2007-02-15 21:43:28 UTC
(In reply to comment #9)
> Carl, isn't this supposed to be fixed?

Yes, it was supposed to be---that's why I was surpised to find this bug here, (and very surprised because the bug report hadn't gotten mailed out to the cairo-bugs list when the bug was originally submitted).

I haven't looked closely at this yet to see what we missed.

-Carl
Comment 11 Mathias Hasselmann 2007-02-16 00:54:47 UTC
Reading in the release notes that this issue shall be fixed reminded me to check if I can deavivate abuse of the image backend in my code.
Comment 12 Carl Worth 2007-03-02 04:00:06 UTC
Created attachment 8947 [details]
Correct output showing things are working in 1.3.15

I just verified that yes, indeed, this bug is already fixed in the 1.3.15 series, (see newly attached output.pdf).

Thanks for the report,

-Carl
Comment 13 Carl Worth 2007-03-02 04:00:36 UTC
This is fixed in 1.3.15 already and the fix will of course be in 1.4.0.

-Carl


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.