Comment 0 for bug 396851

Revision history for this message
Nigel Stanger (nigel-stanger) wrote :

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. ]