Plain SVG export [cli]: '-i -j' fails to fit page size correctly (rev >= r13268)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Medium
|
Mc |
Bug Description
Steps to reproduce:
1) launch current trunk with default (new) prefs, default new document (non-localized)
2) draw a rect in the center of the page
3) save
4) on the command line, query the object id:
$ inkscape -f drawing.svg --query-all
5) export just the rect to PNG:
$ inkscape -f drawing.svg -i rectXXXX -j -e drawing-rect.png
5) export just the rect to a plain SVG file:
$ inkscape -f drawing.svg -i rectXXXX -j -l drawing-
6) compare PNG and SVG export
Expected result:
The document size fits tightly around the visual bbox of the selected object, both in PNG and SVG.
Actual result:
In the exported Plain SVG file, the page borders have been adjusted to match the object's visual bbox size, but the object itself is vertically offset (outside the page borders), and the page area is empty.
Note: the new features committed in r13268 are undocumented at this point (the man page needs to be updated accordingly)
<http://
Reproduced with Inkscape 0.48+devel r13279 on OS X 10.7.5.
Related branches
description: | updated |
summary: |
- trunk: '-i -j' for plain SVG export fails to adjust page size correctly + trunk: '-i -j' for plain SVG export fails to fit page size correctly (rev >= r13268) |
jazzynico (jazzynico) wrote : Re: trunk: '-i -j' for plain SVG export fails to fit page size correctly (rev >= r13268) | #1 |
Changed in inkscape: | |
status: | New → Confirmed |
jazzynico (jazzynico) wrote : | #2 |
> the man page needs to be updated accordingly
New report (affecting inkscape-docs too): Bug #1310266 "Update the man page with '-i -j' for plain SVG export options".
Changed in inkscape: | |
assignee: | nobody → Martin Owens (doctormo) |
su_v (suv-lp) wrote : | #3 |
Another test case which exposes a mismatch of object position and page area is described here:
<https:/
Andreas Böhrnsen (deepflame) wrote : | #4 |
Same issue on Inkscape 0.91pre2 r13516 with Debian Jessie.
Is there a workaround?
Or can it be adjusted automatically afterwards?
Thanks
Andreas Böhrnsen (deepflame) wrote : | #5 |
Hi! Any reply would be highly appreciated. Thanks
Martin Owens (doctormo) wrote : | #6 |
No work-arounds for command line action. Will have to wait for a fix.
Andreas Böhrnsen (deepflame) wrote : | #7 |
Ok, thanks Martin
su_v (suv-lp) wrote : | #8 |
New testcase for export failure attached by jimmac in original (closed) bug #171230:
On 2015-02-20 17:05 (+0100), Jakub Steiner wrote:
> This is the "source" master plate I want to export with:
https:/
> inkscape -f gnome-stencils.svg -l folder.svg -i g4958 -j
> the result of the previous operation: a blank canvas, with the object
> offset down below.
https:/
Changed in inkscape: | |
importance: | Undecided → Medium |
milestone: | none → 0.92 |
su_v (suv-lp) wrote : | #9 |
@Martin - any plans to work on a fix in the near future? Keeping it assigned may discourage other volunteers to take a closer look at what's needed to make this long-requested feature actually useful … The latest librsvg release now includes an option to export per id [1], and will likely soon be favored over Inkscape by Gtk+ icon designers for splitting icon stencil files into individual icons.
--
[1] librsvg 2.40.11: the current implementation is a partial one (better suited for PNG export), as explained in the NEWS section:
https:/
https:/
https:/
summary: |
- trunk: '-i -j' for plain SVG export fails to fit page size correctly - (rev >= r13268) + Plain SVG export [cli]: '-i -j' fails to fit page size correctly (rev >= + r13268) |
Martin Owens (doctormo) wrote : | #10 |
An excellent point. Thanks for the prod.
Changed in inkscape: | |
assignee: | Martin Owens (doctormo) → nobody |
EmanueleSabetta (fmuaddib) wrote : | #11 |
Any hope to see this fixed anytime soon? SVG icons are now widely used in developing mobile apps, and are replacing bitmaps. Scripts like this ( https:/
Mc (mc...) wrote : | #12 |
I have no idea why (I see no rational reason why, I just wanted to simplify the code after failing to understand the source of this bug), but r15218 appears to fix this bug.
Changed in inkscape: | |
milestone: | 0.92 → 0.93 |
assignee: | nobody → Mc (mc...) |
status: | Confirmed → Fix Committed |
EmanueleSabetta (fmuaddib) wrote : | #13 |
This is a great news! So we can finally export indivual elements or groups by id now? They are transformed correctly and a new viewBox is generated that fits the group?
EmanueleSabetta (fmuaddib) wrote : | #14 |
@Mc is there a dev build for 0.93 that I can download with the fix?
Mc (mc...) wrote : | #15 |
For which OS ?
sudo add-apt-repository ppa:inkscape.
to try the bleeding edge dev version on ubuntu-like systems
EmanueleSabetta (fmuaddib) wrote : | #16 |
For OS X
Ruben (chipairon) wrote : | #17 |
@Mc I added the trunk ppa and reinstalled inkscape, but I don't think I have the right build:
sudo apt-cache policy inkscape-trunk
inkscape-trunk:
Installed: 1:0.91.
Candidate: 1:0.91.
Version table:
1:
500 http://
*** 1:0.91.
100 /var/lib/
0.
500 http://
Shouldn't it say 0.93 instead of 0.91?
In any case I have also installed 0.92pre5 from the tarball and this problem still exists.
Couldn't the extraction code do what this command line do to get the desired result?
inkscape --verb FitCanvasToDrawing --verb=FileSave --verb=FileClose logo.svg
Mc (mc...) wrote : | #18 |
0.93 is still far from released.
You need the trunk devel ppa : something like " sudo add-apt-repository ppa:inkscape.
su_v (suv-lp) wrote : | #19 |
@Mc - I think trunk from Inkscape's PPA is called 'inkscape-trunk', installing 'inkscape' will install the stable package. For trunk from PPA, I use this on Ubuntu 14.04:
$ sudo apt-get install inkscape-trunk
And yes, the PPA name of 'inkscape-trunk' is outdated - trunk self-identifies as '0.92+devel', try with:
$ inkscape -V
su_v (suv-lp) wrote : Re: [Bug 1306662] Re: Plain SVG export [cli]: '-i -j' fails to fit page size correctly (rev >= r13268) | #20 |
On 2017-01-04 14:03 (+0100), Ruben wrote:
> In any case I have also installed 0.92pre5 from the tarball and this
> problem still exists.
Please note the milestone of this bug report (0.93): the fix is not part
of Inkscape 0.92 - it will be available in the next major release
Inkscape 0.93, and for testers it is available in current unstable trunk
(Inkscape 0.92+devel).
Patrick Storz (ede123) wrote : | #21 |
I found out why
https:/
fixed the issue in master and pushed a fix to 0.92.x in
https:/
Qantas94Heavy (qantas94heavy) wrote : | #22 |
Fix released in 0.92.3.
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Confirmed on Windows XP, Inkscape trunk revision 13293.