Incorrect import of partially transparent gradients from PDFs created with cairo >= 1.11.4

Bug #1078430 reported by su_v on 2012-11-13
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Unassigned

Bug Description

Follow-up report to
Bug #985206 “PDF output different than SVG source (cairo >= 1.11.2)”

Inkscape (as well as poppler-cairo) fail to correctly convert partially transparent gradients to SVG from PDF files which have been created with Inkscape (stable or trunk) and cairo >= 1.11.4 by saving the attached SVG file as PDF, or printing to file (PDF) via GTK+ print dialog.

Steps to reproduce:
0) install cairo 1.12.8
1) open attached SVG file in Inkscape (stable or trunk)
2) save a copy as PDF (1.4, page area)
3) open just created PDF file in Inkscape (default PDF input extension)

Expected result:
The gradient fills in original SVG and opened PDF look identical (or at least very similar).

Actual result:
The gradient fills are displaced and partially clipped off.

Export (SVG -> PDF):
PDF export with cairo 1.12.4, 1.12.6 and 1.12.8 was tested on OS X 10.7.4 (64bit) with GTK+/Quartz builds of Inkscape 0.48.3.1 and Inkscape 0.48+devel r11871.
PDF export with older versions of cairo (<= 1.12.2) was tested with all official Mac OS X Inkscape packages (>= 0.47, cairo 1.8.8, 1.8.10 and 1.10.2), with local builds on Mac OS X 10.5.8 (32bit) (cairo 1.10.2 (X11), cairo 1.11.4 (Quartz)) and OS X 10.7.4 (64bit) (cairo 1.12.2 (X11)), and on Ubuntu 12.10 (64bit, VM) (cairo 1.12.2).

Import (PDF -> SVG):
Incorrect PDF import was reproduced on Mac OS X 10.5.8 (32bit), OS X 10.7.4 (64bit) and Ubuntu 12.10 (64bit, VM) with:
- Inkscape stable (0.47-0.48.3.1, various cairo and poppler versions)
- Inkscape trunk r11871 (default PDF input extension) [*]
- Inkscape trunk r11871 (experimental PDF via poppler-cairo input extension)
- PDF -> SVG using pdftocairo (from poppler 0.20.4, 0.20.5)
[*] poppler versions don't seem to affect the result (same import with poppler 0.16.6, 0.16.7, 0.18.4, 0.20.4 and 0.20.5)

Notes:
1) Viewing the PDF exported with Inkscape and cairo 1.12.8:
- Evince 2.30.3 (OS X), 3.6.0 (Ubuntu 12.10), Xpdf 3.02 (OS X), Ghostscript 9.06 (Ubuntu 12.10) and Apple's Preview.app (OS X) render the gradients as expected (i.e. like the original SVG)
- Xpdf 3.03 on Ubuntu segfaults
- Ghostscript 9.05 on OS X renders solid fill colors instead of the gradient fills
2) import (PDF -> SVG) via poppler-cairo (external, or with trunk's input extension) results in a different but also incorrect gradients (compared to Inkscape's default PDF import routine).
3) Results with PDFs created outside of Inkscape with librsvg 2.36.4 (cairo 1.12.8):
Broken import not reproduced with:
- Inkscape stable and trunk (default PDF input extension)
Broken import partially reproduced with:
- Inkscape trunk r11871 (experimental PDF via poppler-cairo input extension)
4) Reported issue was not reproduced with fully opaque gradients.

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

Correction:
> 3) Results with PDFs created outside of Inkscape with librsvg 2.36.4 (cairo 1.12.8):
> Broken import not reproduced with:
> - Inkscape stable and trunk (default PDF input extension)

If the PDF is scaled when converting to PDF with rsvg-convert (to match the page size as defined in Inkscape), reopening the PDF file produces the same incorrect gradients as the PDFs exported with Inkscape.

Command line used for the attached file:
$ rsvg-convert --format=pdf --zoom=0.8 --output=04831-1-cairo-1_12_8-librsvg-2_36_4-zoom_0.8.pdf 04831-1.svg

summary: Incorrect import of partially transparent gradients from PDFs created
- with cairo >= 1.12.4
+ with cairo >= 1.12.2
description: updated
su_v (suv-lp) on 2012-11-14
summary: Incorrect import of partially transparent gradients from PDFs created
- with cairo >= 1.12.2
+ with cairo >= 1.11.4
su_v (suv-lp) wrote :

Screenshot comparing rendering of gradients in PDF files created with Inkscape 0.48.3.1 and cairo 1.10.2, 1.11.4, 1.12.2, 1.12.8
(for the screenshot, the PDFs have been opened in Inkscape 0.48+devel r11871 on OS X 10.7.4, GTK+/Quartz 2.24.13)

jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 11871, cairo 1.12.8 (local test).
Not reproduced with cairo 1.11.2.

Changed in inkscape:
importance: Undecided → Medium
status: New → Triaged
su_v (suv-lp) on 2015-10-15
tags: added: cairo

Tested with Inkscape 0.91 r13725 on Kubuntu.

Import with cairo:
* 04831-1-cairo-1_12_8-04831.pdf : not displaced but partially clipped off.
* 04831-1-cairo-1_12_8-librsvg-2_36_4.pdf : not displaced, not clipped off (correct).
* 04831-1-cairo-1_12_8-librsvg-2_36_4-zoom_0.8.pdf : not displaced but partially clipped off.
* 04831-1-cairo-1_12_8-r11871.pdf : not displaced but partially clipped off.

Import with poppler:
* 04831-1-cairo-1_12_8-04831.pdf : not clipped off but displaced and blue gradient not stretched (=circle).
* 04831-1-cairo-1_12_8-librsvg-2_36_4.pdf : not displaced, not clipped off but blue gradient not stretched (=circle).
* 04831-1-cairo-1_12_8-librsvg-2_36_4-zoom_0.8.pdf : not clipped off but displaced and blue gradient not stretched (=circle).
* 04831-1-cairo-1_12_8-r11871.pdf : not clipped off but displaced and blue gradient not stretched (=circle).

To post a comment you must log in.