Crash in console mode resulting from rev. 20388
Inkscape suddenly crashes for me when using the command line export functionality (in some cases at least). It seems to crash in SPDesktop::doc2dt, probably due to a null-pointer dereference. This function is called from sp_item_i2d_affine now, since rev. 20388. And this was also one of the few revisions since I last updated, so it could very well have to do with this revision.
My guess is that there simply isn't any instance of SPDesktop when Inkscape is used as a command line executable. So possibly the error isn't in sp_item_i2d_affine as such, but rather in the fact that it is being called at all. If anyone with a bit more understanding of this area of the code could have a look that would be great.
On Sat, Dec 20, 2008 at 3:19 PM, Jasper van de Gronde
My guess is that there simply isn't any instance of SPDesktop when Inkscape is used as a command line executable. So possibly the error isn't in sp_item_i2d_affine as such, but rather in the fact that it is being called at all. If anyone with a bit more understanding of this area of the code could have a look that would be great.
You are right. In command line mode, there are no desktops, only documents. So, desktops should only be used in UI code, never in low-level rendering code.
bulia byak wrote, On 12/20/08 20:27:
On Sat, Dec 20, 2008 at 3:19 PM, Jasper van de Gronde
My guess is that there simply isn't any instance of SPDesktop when Inkscape is used as a command line executable. So possibly the error isn't in sp_item_i2d_affine as such, but rather in the fact that it is being called at all. If anyone with a bit more understanding of this area of the code could have a look that would be great.
You are right. In command line mode, there are no desktops, only documents. So, desktops should only be used in UI code, never in low-level rendering code.
I didn't know that you can't count on the presence of an active desktop.
Hmm... but still the command line export uses "desktop" coordinates (with --export-area=x0:y0:x1:y1) and the function sp_export_png_file expects an area in desktop coordinates as well. The transformation is trivial and is done there by coordinate flipping and shifting by document height.
I'll revert the change from revision 20388 for now which caused the crash.
Thomas
On Sat, Dec 20, 2008 at 9:06 PM, Thomas Holder
Hmm... but still the command line export uses "desktop" coordinates (with --export-area=x0:y0:x1:y1) and the function sp_export_png_file expects an area in desktop coordinates as well. The transformation is trivial and is done there by coordinate flipping and shifting by document height.
Well, I wonder if we should better eliminate the desktop coords transform here. Command line is for power users, who will more likely need the true SVG coordinates. At least, here is the change that I did for version 0.44:
The --query-* command line parameters now return the true SVG bounding box of the object instead of the Inkscape coordinate system bbox (with inverted Y axis). The new behavior makes more sense for scripting use of Inkscape. (http://wiki.inkscape.org/wiki/index.php/ReleaseNotes044)
so I think we must change all other command line parameters to match this behavior.
bulia byak wrote:
The --query-* command line parameters now return the true SVG bounding box of the object instead of the Inkscape coordinate system bbox (with inverted Y axis). The new behavior makes more sense for scripting use of Inkscape. (http://wiki.inkscape.org/wiki/index.php/ReleaseNotes044)
so I think we must change all other command line parameters to match this behavior.
Could you document the different coordinate systems used in Inkscape on the wiki? I have also run into problems with different coordinate systems when rewriting the clipboard code and I put in a manual hack like the one in png export routines.
Regards, Krzysztof Kosiński
participants (4)
-
bulia byak
-
Jasper van de Gronde
-
Krzysztof Kosiński
-
Thomas Holder