After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 520654 - add --export-id paramater
add --export-id paramater
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
2.22.x
Other All
: Normal enhancement
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-06 01:57 UTC by Jakub Steiner
Modified: 2017-12-13 17:30 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Jakub Steiner 2008-03-06 01:57:28 UTC
Inkscape allows to export a specific area by passing an object id on the commandline. This is extremely useful for 'cropping' out a large SVG into smaller chunks. The reason I humbly request this to be added in rsvg as well is that inkscape is a rather unreasonable dependency for doing build-time rendering for an icon theme. Depending on rsvg is much more sane.

The two options that are interesting:

 -i, --export-id=ID                        The ID of the object to export
 -j, --export-id-only                      Export just the object with
                                            export-id, hide all others (only
                                            with export-id)

the -x -y -w -h parameters should be respected even when -i is passed.
Comment 1 Jakub Steiner 2015-10-20 13:44:37 UTC
The behavior has been implemented with the --export-id parameter in https://git.gnome.org/browse/librsvg/commit/?id=fecfcce44a959daff80a4e0f9ced83d7cdcb5903

However few things need to be addressed before this can get used in adwaita-icon-theme (wip/rsvg-cropping branch):

- all cropped rectangles are 20x20 rather than 16x16px the original group had (pt vs px).
- some icons have completely wild canvas size
- special class attributes aren't retained (used for special
  coloring on gtk side, e.g class="warning") 

The last one not being a blocker and having a lot lower priority than the other two.
Comment 2 Mike Hommey 2015-10-27 05:21:07 UTC
This changed the behavior of the -w and -h parameters on the command line, when given with nothing else. Before, doing rsvg-convert -w 48 -h 48 would scale, now it crops.
Comment 3 Mike Hommey 2015-10-27 05:33:44 UTC
And in fact, this regression is all caused by the "In addition, this get rid of a deprecated call to rsvg_handle_set_size_callback()" part of the commit.
Comment 4 Mike Hommey 2015-10-27 05:58:18 UTC
It turns out the cairo surface is never set up properly to do the scaling, and the code was kind of relying on the rsvg_handle_set_size_callback call to set things up.
Comment 5 Mike Hommey 2015-10-27 06:06:00 UTC
And in fact, more than -w/-h are broken. -x and -y are equally broken.
Comment 6 Michael Biebl 2015-11-17 15:52:40 UTC
Jakub, do you have any feedback on this?
Comment 7 Michael Biebl 2015-11-17 16:09:02 UTC
FYI: I reverted this commit in the Debian librsvg package until a proper solution is found upstream.
Comment 8 Michael Biebl 2016-02-15 23:46:03 UTC
I filed a separate bug for this: https://bugzilla.gnome.org/show_bug.cgi?id=762115
Comment 9 GNOME Infrastructure Team 2017-12-13 17:30:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/16.