save as dialogue, duplicate 'Compressed Inkscape SVG' entry

Bug #167472 reported by Bjorn Hansen
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

Open a save as dialogue and the dropdown menu in the
lower right which allows selection of the file type has
two entries for 'Comperssed Inkscape SVG (*.svgz)'.
The first is fourth from the top, and the second is
fourth from the bottom. (this is in the 0.42 release)

Revision history for this message
Rwst (rwst) wrote :

fixed 20056-09-25 by gouldtj so please use a newer version
like 0.43

Revision history for this message
dopelover (dopelover) wrote :

This problem reappeared recently, moreover export using lower menu entry (highlighted on attached screenshot) produces empty file. I noticed the issue yesterday.

Inkscape: 0.46+dev (build from svn source : 23 of June 2009)
OS: Ubuntu 9.04 32 bit

dopelover (dopelover)
Changed in inkscape:
status: Invalid → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Confirmed on OS X 10.5.7, Inkscape 0.46+devel r21674:
first '.svgz' popup menu entry saves ok, second '.svgz' entry produces empty file.

SVN commit referenced in Comment 1:

  Revision 9554 - (view) (download) (annotate) - [select for diffs]
  Modified Sun Sep 25 07:00:23 2005 UTC (3 years, 8 months ago) by gouldtj
  File length: 6175 byte(s)
  Diff to previous 9436

  In GTK+ 2.8 they seem to have added support for svgz and svg.gz, but we
  want to handle those ourself also. Making it so that they don't get
  included by the GDK pixbuff code.

<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/extension/internal/gdkpixbuf-input.cpp?view=log>

Revision history for this message
su_v (suv-lp) wrote :

After failing to write to the '.svgz' file, Inkscape returns

 Can't Spawn!!! spawn returns: 8

when quitting the application. occurs in 'src/extension/implementation/script.cpp', line 1029
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/extension/implementation/script.cpp?view=log>

Revision history for this message
Alvin Penner (apenner) wrote :

    same here on Windows XP. The .svgz option at the bottom of the Save As dialog calls up the external extension file \share\extensions\svgz_output.inx. This in turn calls up the program gzip. You must have gzip in the path for this to work.
    However, on my machine it still does not work. Running gzip offline from a DOS prompt works well, but running from Inkscape produces the message as above :

C:\Program Files\Inkscape>inkscapec
terminate called after throwing an instance of 'Glib::SpawnError'

Revision history for this message
su_v (suv-lp) wrote :

Looks like the support for <command reldir="path">somecommand -with -arguments</command> is currently broken.

test (succeeded on OS X):
1) replace the command 'gzip -c' with 'cat' in svgz_output.inx
2) restart Inkscape, save new drawing as 'Compressed Inkscape SVG (*.svgz)' (the second entry)
3) result: 'drawing.svgz' which is simply the contents of 'drawing.svg' piped through 'cat' into 'drawing.svgz'. This works without error.

Commands with parameters apparently fail when being called directly from an 'inx'-file. Quoting them with ''' or '"' didn't work either. Thus the extensions based on svgz_output.inx, svgz_input.inx and ai_input.inx fail.

I don't know what changed, but the function in inkscape/trunk/src/extension/implementation/script.cpp that returns "Can't Spawn!!! …" catches a GLIB::SpawnError?

 1019 try {
 1020 Inkscape::IO::spawn_async_with_pipes(Glib::get_current_dir(), // working directory
 1021 argv, // arg v
 1022 Glib::SPAWN_SEARCH_PATH /*| Glib::SPAWN_DO_NOT_REAP_CHILD*/,
 1023 sigc::slot<void>(),
 1024 &_pid, // Pid
 1025 NULL, // STDIN
 1026 &stdout_pipe, // STDOUT
 1027 &stderr_pipe); // STDERR
 1028 } catch (Glib::SpawnError e) {
 1029 printf("Can't Spawn!!! spawn returns: %d\n", e.code());
 1030 return 0;
 1031 }

currently failing extensions:
LeWitt:extensions suv$ grep reldir *.inx|grep -v extensions
ai_output.inx: <command reldir="path">gs -q -dNODISPLAY -dSAFER ps2ai.ps</command>
svgz_input.inx: <command reldir="path">gzip -cd</command>
svgz_input.inx: <check reldir="path">gzip</check>
svgz_output.inx: <command reldir="path">gzip -c</command>
LeWitt:extensions suv$

Revision history for this message
su_v (suv-lp) wrote :

Could this be an uncatched error when quoting/unquoting the script / command path?

<https://bugs.launchpad.net/inkscape/+bug/187290/comments/57>: Ulferikson wrote on 2008-03-27:
3.) When the inkscape directory contains spaces, such as "C:\Program Files\", you might need to quote script paths (and the code to unquote it looks broken).
Comment #47, https://bugs.launchpad.net/inkscape/+bug/187290/comments/47, has a patch for this, but it needs more testing to see that it works and doesn't break anything else.

and <https://bugs.launchpad.net/inkscape/+bug/187290/comments/59>: Rygle wrote on 2008-03-28:
[…] Is the unquote thing a problem (see 2 posts up from Ulf). If you think it might be a problem, how can we test this? What menu command, or process can we do to test? Need to be able to nail it down. Thanks!

Revision history for this message
Kattekrab (donna) wrote :

Inkscape 0.46+devel r21793, built Jul 12 2009
on Ubuntu

(sorry haven't baked a 0.47pre2 yet - will check for this once I have)

Naive Question.
If the top one works, and the bottom one does not, isn't it simply a matter of removing the bottom entry from the select list? :)

Screenshot attached.

Revision history for this message
su_v (suv-lp) wrote :

The list is built dynamically from the available external and internal extensions (though I don't know what determines the sort order), as far as I know Tav has noted the duplicity <http://article.gmane.org/gmane.comp.graphics.inkscape.devel/31021> and hopefully the external extension for 'Compressed SVG' will be removed from trunk before the release.

Revision history for this message
su_v (suv-lp) wrote :

Revision 22238 by gouldtj
Removing svgz_[input|output].inx

Revision history for this message
su_v (suv-lp) wrote :

Closing this report as 'Fix released' (in revision 22238 by gouldtj)

new bug report for the underlying <command ...> issue in extension definition files:
bug #431290 “[inx] <command reldir="path">somecommand -with -arguments</command> fails”

Changed in inkscape:
status: Confirmed → Fix Released
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.