all relative links become absolute when using extensions

Bug #498649 reported by Arch Dude
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Medium
Unassigned

Bug Description

When the extension "Color Markers to Match Stroke" is used on any object (or even on no selected object), then all link on all objects, selected or not, become absolute. Observes in 0.47 and 0.48. Not tested on earlier releases.

Steps to reproduce:
  1)create a new file
  2)create an object
  3)create a link on the object
  4)in the link properties, add a relative link inthe href field (e.g., relative.svg)
  5)use xml editor to observe that the xlink is still relative
  5)de-select the object (or leave it selected: no difference)
  6)execute the "Color Markers to Match Stroke" extension. there is no difference if paths with markers exist or not.
 7)use xml editor to observe that the xlink has chaned to absolute.

The use of relative links is explicitly allowed in the SVG standard and is essential for use in large sites hierarchical sites.

this bug may be relates #272520 and to #498645

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

reproduced with Inkscape 0.47 and 0.47+devel r8894 on OS X 10.5.8

This is not limited to the mentioned extension: apparently extensions that modify existing objects or insert/render new objects trigger a rewriting of the paths stored in 'xlink:href' attributes in the whole document: all
- (manually edited) relative links to imported bitmap images
- object links (implemented as attributes of a wrapped parent group to the selected/linked object)
are changed from relative to absolute filenames.

In parts reproduced with Inkscape 0.46:
only the relative links for imported/linked bitmap images are rewritten, relative object links stay untouched after using an effect like 'Render > Gear...' or 'Modify Path > Color Markers to Match Stroke'.

Changed in inkscape:
status: New → Confirmed
tags: added: extensions-plugins link regression
Changed in inkscape:
importance: Undecided → Medium
Revision history for this message
jazzynico (jazzynico) wrote :

Tried again with python extensions from various menus, and the bug can be reproduced every time with trunk revision 11398.
Not reproduced with internal extensions (Render>Grids>Grid, filters...), and import/export extensions (XSLT and and python based).

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
jazzynico (jazzynico) wrote :

Apparently, all the xlink:href attributes of the document are converted to absolute links by Script::solve_reldir (in src/extensions/implementation/script.cpp) so that the scripts can use them. But they don't get their relative value when the script is terminated.

The links of the <image> elements are converted to relative by rebase_hrefs (in src/xml/rebase-hrefs.cpp) when saving the document, but nothing is done for <a> elements. Improving rebase_href to take all elements into account (and maybe calling rebase_href after the script execution) should fix the issue.

jazzynico (jazzynico)
summary: - all relative links become absolute when "Color Markers to Match Stroke"
- is used
+ all relative links become absolute when using extensions
Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

Hi - thanks for reporting this bug, I've manually migrated it to Inkscape's new bug tracker on GitLab, and closed it here.

Please feel free to file new bugs about the issues you're seeing at http://inkscape.org/report.

Moved to: https://gitlab.com/inkscape/inbox/issues/2303
Closed by: https://gitlab.com/jhofinger

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

Other bug subscribers

Related questions

Remote bug watches

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