Bug 60489 - Artifacts being introduced in SVG rendering to PNG in versions later than 1.10.2
Summary: Artifacts being introduced in SVG rendering to PNG in versions later than 1.10.2
Alias: None
Product: cairo
Classification: Unclassified
Component: svg backend (show other bugs)
Version: 1.12.10
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Emmanuel Pacaud
QA Contact: cairo-bugs mailing list
Depends on:
Reported: 2013-02-08 12:16 UTC by Finnian Reilly
Modified: 2013-02-08 13:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Test SVG file for script scaling.py (621.50 KB, text/plain)
2013-02-08 12:16 UTC, Finnian Reilly
Python test script for waterfal.svg (188 bytes, text/plain)
2013-02-08 12:18 UTC, Finnian Reilly
Compressed SVG test file for script (621.50 KB, application/x-gzip)
2013-02-08 12:25 UTC, Finnian Reilly

Description Finnian Reilly 2013-02-08 12:16:22 UTC
Created attachment 74421 [details]
Test SVG file for script scaling.py

The 1.12.2 and 1.12.10 versions of libcairo2 introduces a rendering bug that was not present in version 1.10.2. It is possible the bug may also be in later versions.

The rendering problem shows up when using the rsvg utility to convert the attached SVG file to PNG format. (See package librsvg2-bin) 

On my machine I am running Ubuntu 12.10 amd64 which has libcairo2-1.12.2. Save the attached file 'waterfall.svg.gz' and Python script 'scaling.py' into a test directory. Unzip the SVG file with gunzip. Make sure package librsvg2-bin is installed.

File: scaling.py
import subprocess
for width in range (400, 900, 100):
    print 'Converting to width:', width
    subprocess.call (['rsvg', '--width', str (width), 'waterfall.svg', ,waterfall.%s.png' % width])

Run the script from the command line. The script outputs 5 PNG files ranging in width from 400 to 800. The first and last PNG do not have any problem, but the 500, 600 and 700 width files all have major artifacts.

Create a subdirectory 'libs'. Into this directory extract the shared object 'libcairo.so.2.xxxxx.x' for various versions. Select the one for testing by creating a link. This selects the 1.10.2 version:

    ln libs/libcairo.so.2.11000.2 libs/libcairo.so.2

set the library path as follows

export LD_LIBRARY_PATH=libs

Run the test script again and examine the output. You will find that the 1.10.2 version produces images without any artifacts.

This bug has also been reported here with a different wording.+
Comment 1 Finnian Reilly 2013-02-08 12:18:28 UTC
Created attachment 74422 [details]
Python test script for waterfal.svg

Use the script to reproduce the bug
Comment 2 Finnian Reilly 2013-02-08 12:25:11 UTC
Created attachment 74423 [details]
Compressed SVG test file for script

The first time I uploaded it I forgot to set the content type to 'auto-detect'.
Comment 3 Finnian Reilly 2013-02-08 12:27:17 UTC
Comment on attachment 74421 [details]
Test SVG file for script scaling.py

Please ignore this bad upload. I don't know how to delete it.
Comment 4 Chris Wilson 2013-02-08 13:14:43 UTC
commit 8cfbdf2f02ba01d5638a91c9f3f7fc228b402caa
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 8 13:10:25 2013 +0000

    polygon: Only rely on the computed boundary intersections for crossing edges
    If we need to extrapolate the edge to the boundary, then we run the risk
    of an overflow for an immaterial result. So if the edge does not cross
    the boundary, we can simply use the corresponding end-point and not emit
    the boundary segment.
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60489
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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.