Inkscape does not correctly render svg and pdf files when using complex filters.

Bug #808898 reported by Martin Constantino–Bodin
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Medium
Unassigned
inkscape (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Hi!
This is the first time I can complain to Inkscape, it’s really a very good software, useful and user-friendly. But well, all happens…

I’ve got some problem using some filters with Inkscape those times. In Inkscape itself there is absolutely no problem: all the problems is on exportations.
I have a guilty image which have a very different render in its output and in Inkscape itself.
This guilty image contains mainly two elements:
 — a circle, deformed by two filters in the menu deformation. I don’t know the english names of these filters, but in French it’s « Agitation dilatée » (dilated agitation?) and « Pourtour déchiré » (torn borders?). This one is well rended in all format.
 — a background, which is a blue square (with some stars, but they are not important there I guess) transformed to paths to which I’ve removed a copy of the deformed circle. This one is sometimes removed in the renderings…

To illustrate this bug, I’ve attached the following files in a compressed file:
 — 1.svg: the Inkscape’s SVG created by Inkscape. Inkscape can read it well (I’ve taken a screenshot in screenshot1.png of what Inkscape display when openning it.), but not eog (see screenshot2.png).
 — 2.svg: the plain SVG created by Inkscape (from 1.svg). This one is nearly (expect in the borders) well rendered by eog (screenshot3.png), and Inkscape can read it without problem (screenshot4.png).
 — 3.pdf: the pdf created by Inkscape (from 1.svg). This file is not well rendered in Evince (screenshot5.png), it makes Xpdf crash (but maybe it’s not Inkscape’s fault there). Inkscape doesn’t render it too (screenshot6.png).
 — 4.png: the png created by Inkscape (from 1.svg).

As you can see, the background is most of the time not rendered by program else than Inkscape, and the pdf file is not well rendered by Inkscape itself…
I don’t know exactly what’s wrong.

Hoping these informations will help.
Martin.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: inkscape 0.48.1-2ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-10.46-generic 2.6.38.7
Uname: Linux 2.6.38-10-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
CheckboxSubmission: 01a18e0a74cbde3d34a62f62830ed079
CheckboxSystem: f134069bba098730d27f59b402920826
Date: Mon Jul 11 18:56:52 2011
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 LANGUAGE=fr_FR:en
 LANG=fr_FR.utf8
 SHELL=/bin/bash
SourcePackage: inkscape
UpgradeStatus: Upgraded to natty on 2011-05-03 (69 days ago)

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :
Revision history for this message
su_v (suv-lp) wrote :

a) Issue with PDF export reproduced with Inkscape 0.48.1 on Mac OS X 10.5.8 (i386)

Problem: parent layer of masked group has a 'transform' attribute which is ignored/incorrectly compensated for the masked group.
  <g
     inkscape:label="Calque 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(-352.85714,-166.29075)">

Workaround:
1) open in Inkscape
2) add a new layer
3) move both objects (masked group, filtered ellipse) to the new layer
4) save a copy as PDF

Related to or duplicate of
Bug #743053“Exporting mask with gradient to EPS results in blank page”

b) Complex mask (group of paths with complex filter effects) on a transformed group fails to be rendered in other SVG viewers:
Reproduced with rsvg-view (librsvg 2.34.0), Squiggle (Batik 1.7) Opera 11.5, Chromium 14.0.786.0 on Mac OS X 10.5.8 (i386)
Not sure, whether Inkscape's code is wrong, or other SVG renderers don't support the nested levels of transformed (translated) groups, e.g.

    <g
       id="g3289-4"
       transform="translate(837.14285,6.0714171)"
       mask="url(#mask3104)">

Possible workaround: reduce level of nested transforms:
1) Move masked object to new layer as described above.
2) Release the mask, ungroup the group with the stars and group it again (to get rid of the group transform attribute),
3) Reapply the mask

Now the image displays in Squiggle (Batik), Opera and Chromium the same way as it does in Inkscape. rsvg-view from librsvg 2.34.0 still fails, but I don't think that's an issue with Inkscape itself or its SVG code - librsvg, AFAIK also used for EOG, is known to support fewer SVG 1.1 features than e.g. Inkscape.

tags: added: exporting masking pdf
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

c) It appears that the PDF created based on the workaround in (a) above doesn't render the nested filter effects applied as style to the masking group.

Workaround:
use a bitmap copy of the current mask (filtered group of paths) as mask (keep the original, vector-based filter group on a hidden layer for later editing).

Revision history for this message
su_v (suv-lp) wrote :

PDF Issue can't be properly tested with the new cairo-renderer in current trunk: Saving a copy as PDF crashes with Inkscape 0.48+devel r10444:

Assertion failed: (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)), function cairo_surface_destroy, file cairo-surface.c, line 637.

Same backtrace as when printing / previewing a print, reported in
Bug #806105 “Inkscape crashes in print preview”

Revision history for this message
su_v (suv-lp) wrote :

Backtrace after crash when saving a copy as PDF of the file '1.svg' in Inkscape 0.48+devel r10444 on Mac OS X 10.5.8 (i386)

Changed in inkscape (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Beluga (buovjaga) wrote :

Saving 1.svg to pdf does not crash anymore.
Background is still not saved in pdf.

Arch Linux 64-bit, KDE Plasma 5
Inkscape 0.92pre1 15054 (GTK3)

jazzynico (jazzynico)
Changed in inkscape:
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.