Command-line PNG export path inconsistency

Bug #396851 reported by Nigel Stanger
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned
samba
Fix Committed
Low
Alexander Bokovoy

Bug Description

Inkscape 0.47pre0 and pre1, Mac OS Leopard (10.5.7) build, but possibly all platforms (currently don't have access to the resources to test this). Was definitely NOT present in the 0.46 stable release.

When exporting to PNG via the command line (--export-png), the output path appears to be relative to the input file. This is inconsistent with, for example, --export-pdf, where the input and output files are independent. This means that Inkscape may try to write the PNG to a non-existent path and thus fail.

Examples (my commentary in [brackets]):

% inkscape --file=images/foo.svg --without-gui --export-pdf=images/foo.pdf
[ This works, creating images/foo.pdf as expected. ]

% inkscape --file=images/foo.svg --without-gui --export-png=images/foo.png
[ This produces a critical error at the point of trying to write the file, output follows: ]
Background RRGGBBAA: ffffff00
Area 0:0:744.094:1052.36 exported to 744 x 1052 pixels (90 dpi)
Bitmap saved as: images/foo.png

** (inkscape-bin:34861): CRITICAL **: bool sp_png_write_rgba_striped(SPDocument*, const gchar*, long unsigned int, long unsigned int, double, double, int (*)(const guchar**, int, int, void*), void*): assertion `fp != NULL' failed
[ Inkscape then exits normally (so no crash, and hence no backtrace), but foo.png is not created. ]

% inkscape --file=images/foo.svg --without-gui --export-png=foo.png
[ This works, creating images/foo.png, but you would normally expect it to create ./foo.png. It appears to be inheriting the path from the input file, which is NOT the case with --export-pdf. Note that this latter example is an obvious workaround for the bug until it's fixed. ]

description: updated
Revision history for this message
bbyak (buliabyak) wrote :

confirmed with last svn on linux

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Alexander Bokovoy (abbra) wrote :

This regression in Inkscape behaviour broke generation of Samba documentation. For time being I fixed it by always using absolute paths passed to Inkscape. However, this change in the behaviour is weird and counter-intuitive and needs to be fixed.

Changed in samba:
status: New → Confirmed
Revision history for this message
Alexander Bokovoy (abbra) wrote :

Fixed in Samba git by using absolute paths when calling Inkscape. http://git.samba.org/?p=samba.git;a=commitdiff;h=217e3086c74eb0b46fab512b5887d9a5a5b7ee9a

Changed in samba:
assignee: nobody → Alexander Bokovoy (ab-samba)
status: Confirmed → Fix Committed
importance: Undecided → Low
Revision history for this message
bbyak (buliabyak) wrote :

fixed in 22118: now relative path is absolutized with regard to document location only if it is an export hint stored in that document; otherwise - for example if it's filename specified on the command line - it is not absolutized, which in effect means it works with regard to the current working dir from which you launch the command. Please test and let me know if this fixes it for you.

Changed in inkscape:
status: Confirmed → Fix Released
su_v (suv-lp)
tags: added: cli exporting
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.