bugGNU Octave - Bugs: bug #56768, Unable to print SVG files when the...

 
 

bug #56768: Unable to print SVG files when the path has spaces

Submitter:  Blbulyan David <davidblbulyan>
Submitted:  Sat 17 Aug 2019 07:02:40 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  pantxo
Originator Name:  Blbulyan David Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 22 Aug 2019 03:14:58 AM UTC, comment #16: 

Thank you for the quick fix Pantxo!

The OP confirmed that the patch of comment #11 is working, I can confirm the same.

The patch will be included in whatever the next release of Octave is.

Closing as fixed.

Kai Torben Ohlhus <siko1056>
Group Member
Tue 20 Aug 2019 07:09:32 PM UTC, comment #15: 


комментарий №13:

>
> комментарий №11:
> > I pushed the following simple patch to stable that fixes the issue:
> >
> > http://hg.savannah.gnu.org/hgweb/octave/rev/493922902ae9
> >
> > Marking ready for test.
> >
> > @davidblbulyan: Since it is a simple modification of a .m file, if you don't want to wait for the next/fixed version of Octave, you can do that simple change in your print.m source file.
> I can’t edit the file, I don’t know where it is, when debugging, they write me the path to it: "/app/share/octave/5.1.0/m/plot/util/print.m" and I do not have any app folder in the root folder.
>
>
>

I found where it lies, and fixed it, this bug disappeared. Here is the full path:
/var/lib/flatpak/app/org.octave.Octave/x86_64/stable/246709717fa2b00015a79d2c14306d05f544e1c01c2ab91b09fdc800df84fb35/files/share/octave/5.1.0/m/plot/util

Blbulyan David <davidblbulyan>
Tue 20 Aug 2019 06:37:09 PM UTC, comment #14: 


комментарий №13:

>
> комментарий №11:
> > I pushed the following simple patch to stable that fixes the issue:
> >
> > http://hg.savannah.gnu.org/hgweb/octave/rev/493922902ae9
> >
> > Marking ready for test.
> >
> > @davidblbulyan: Since it is a simple modification of a .m file, if you don't want to wait for the next/fixed version of Octave, you can do that simple change in your print.m source file.
> I can’t edit the file, I don’t know where it is, when debugging, they write me the path to it: "/app/share/octave/5.1.0/m/plot/util/print.m" and I do not have any app folder in the root folder.
>
>
>

Octave installed using flatpak.

Blbulyan David <davidblbulyan>
Tue 20 Aug 2019 06:34:58 PM UTC, comment #13: 


комментарий №11:

> I pushed the following simple patch to stable that fixes the issue:
>
> http://hg.savannah.gnu.org/hgweb/octave/rev/493922902ae9
>
> Marking ready for test.
>
> @davidblbulyan: Since it is a simple modification of a .m file, if you don't want to wait for the next/fixed version of Octave, you can do that simple change in your print.m source file.

I can’t edit the file, I don’t know where it is, when debugging, they write me the path to it: "/app/share/octave/5.1.0/m/plot/util/print.m" and I do not have any app folder in the root folder.



Blbulyan David <davidblbulyan>
Tue 20 Aug 2019 04:47:38 PM UTC, comment #12: 


>> plot (1:10)
>> mkdir "path with space"

ans = 1

>> print "path with space/toto.svg"

stopped in /app/share/octave/5.1.0/m/plot/util/print.m at line 416
416:   opts = _print_parse_opts_ (varargin{:});
debug> varargin
varargin =
{
  [1,1] = path with space/toto.svg
}

debug> dbcont
Usage:
octave-svgconvert infile fmt dpi font reconstruct outfile

Convert svg file to pdf, or svg. All arguments are mandatory:

  • infile: input svg file or "-" to indicate that the input svg file should be read from stdin
  • fmt: format of the output file. May be one of pdf or svg
  • dpi: device dependent resolution in screen pixel per inch
  • font: specify a file name for the default FreeSans font
  • reconstruct: specify wether to reconstruct triangle to polygons (0 or 1)
  • outfile: output file name

error: gl2ps_renderer::draw: internal pipe error

>> error: parse error

error: called from
    _opengl_print_ at line 193 column 7
    print at line 710 column 16

>>

Blbulyan David <davidblbulyan>
Tue 20 Aug 2019 02:05:51 PM UTC, comment #11: 

I pushed the following simple patch to stable that fixes the issue:

http://hg.savannah.gnu.org/hgweb/octave/rev/493922902ae9

Marking ready for test.

@davidblbulyan: Since it is a simple modification of a .m file, if you don't want to wait for the next/fixed version of Octave, you can do that simple change in your print.m source file.

Pantxo Diribarne <pantxo>
Group Member
Tue 20 Aug 2019 01:30:36 PM UTC, comment #10: 

Thanks, now I can confirm. The following is enough to reproduce the issue:


plot (1:10)
mkdir "path with space"
print "path with space/toto.svg"


I'll change the title to better reflect the actual issue. I'll look into this.

Pantxo Diribarne <pantxo>
Group Member
Tue 20 Aug 2019 11:58:36 AM UTC, comment #9: 

I used the menu item "File> Save As" for my charts, now, this is the output for the item "File> Save":

>> close all
>> plot (1:10)
>> dbstop print

ans =  416

>> close all
>> plot (1:10)
>> dbstop print

ans =  416

>> stopped in /app/share/octave/5.1.0/m/plot/util/print.m at line 416

416:   opts = _print_parse_opts_ (varargin{:});
debug> varargin
varargin =
{
  [1,1] =  1
  [1,2] = /home/david/toto.pdf
  [1,3] = -dpdf
}



For the .svg file (I save through the "Save As" dialog):

>> close all
>> plot (1:10)
>> dbstostopped in /app/share/octave/5.1.0/m/plot/util/print.m at line 416

416:   opts = _print_parse_opts_ (varargin{:});
debug> varargin
varargin =
{
  [1,1] =  1
  [1,2] = /home/david/toto.svg
  [1,3] = -dsvg
}

debug> dbcont
Gtk-Message: 14:33:40.320: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:33:40.341: Failed to load module "canberra-gtk-module"



For my script(.svg)(zatuhayuchie_colebania.m):
warning: legend: specifying location with a numeric argument is obsolete and will be removed from a future version of Octave, use a string specification instead
warning: called from
    legend at line 211 column 7
    zatuhayuchie_colebania at line 26 column 1

>> dbcontstopped in /app/share/octave/5.1.0/m/plot/util/print.m at line 416

416:   opts = _print_parse_opts_ (varargin{:});
debug> varargin
varargin =
{
  [1,1] =  2
  [1,2] = /home/david/Программы GNU Octave/zc.svg
  [1,3] = -dsvg
}

debug> dbcont
Usage:
octave-svgconvert infile fmt dpi font reconstruct outfile
Convert svg file to pdf, or svg. All arguments are mandatory:

  • infile: input svg file or "-" to indicate that the input svg file should be read from stdin
  • fmt: format of the output file. May be one of pdf or svg
  • dpi: device dependent resolution in screen pixel per inch
  • font: specify a file name for the default FreeSans font
  • reconstruct: specify wether to reconstruct triangle to polygons (0 or 1)
  • outfile: output file name

error: gl2ps_renderer::draw: internal pipe error
error: parse error
error: called from
    _opengl_print_ at line 193 column 7
    print at line 710 column 16
    saveas at line 110 column 3
    _add_default_menu_>__save_as__ at line 145 column 7
    _add_default_menu_>save_cb at line 126 column 5

>>



For my script(.pdf)(zatuhayuchie_colebania.m):

>> stopped in /app/share/octave/5.1.0/m/plot/util/print.m at line 416

416:   opts = _print_parse_opts_ (varargin{:});
debug> varargin
varargin =
{
  [1,1] =  2
  [1,2] = /home/david/Программы GNU Octave/zc.pdf
  [1,3] = -dpdf
}

debug> dbcont
warning: print: only ASCII characters are supported for EPS and derived formats.
warning: called from
    _opengl_print_ at line 193 column 7
    print at line 710 column 16
    saveas at line 110 column 3
    _add_default_menu_>__save_as__ at line 145 column 7
    _add_default_menu_>save_cb at line 126 column 5



The .pdf file for my script was saved, but without the Cyrillic alphabet inside it, well, that is, there are no Russian signatures of units for axis labels and there is no graph name.
I also noticed a bug that even if I explicitly choose another folder in the "Save As" dialog, for some reason the folder is still selected "/home/david/Программы GNU Octave/". I don’t know, maybe it’s stuck, I will restart the octave and check.

Blbulyan David <davidblbulyan>
Mon 19 Aug 2019 10:10:50 PM UTC, comment #8: 

@davidblbulyan: Thanks, so uiputfile does seem to work well. Can you inspect directly the arguments to the print function:


close all
plot (1:10)
dbstop print


Now save your figure to e.g. "/home/david/toto.pdf" using the File>Save dialog. Once you've pressed the "Save" button, the command window prompt have switched to debug mode at the first line of print.m. If you type "varargin" you should see all the arguments passed to the function.

In my case varargin contians the following:


>> stopped in print at line 407 [/media/pantxo/datadisk/dev/octavebuild/../octaveclone/scripts/plot/util/print.m]
407:   opts = __print_parse_opts__ (varargin{:});
debug> varargin
varargin =
{
  [1,1] =  1
  [1,2] = /home/pantxo/toto.pdf
  [1,3] = -dpdf
}

debug> dbcont


Pantxo Diribarne <pantxo>
Group Member
Mon 19 Aug 2019 08:48:20 PM UTC, comment #7: 

For an existing file:
[FNAME, FPATH, FLTIDX] = uiputfile ()
FNAME = untitled.jpg
FPATH = /home/david/Программы GNU Octave/
FLTIDX = 0
For an not existing file:

>> [FNAME, FPATH, FLTIDX] = uiputfile ()

FNAME = awdadwadawdawdasdaw.txt
FPATH = /home/david/Программы GNU Octave/
FLTIDX = 0

>>

Blbulyan David <davidblbulyan>
Mon 19 Aug 2019 10:42:16 AM UTC, comment #6: 

No, what I want is to know wether the issue comes from the file selection user interface (since the low level "print" part does seem to work). So what I would like is you to run the following command in a command window:


[FNAME, FPATH, FLTIDX] = uiputfile ()
## Select an existing file, hit save, tell us the content of the variables FNAME, FPATH, FLTIDX
## Same for a non existing file


For example, if I select a non existing file on my desktop with name "toto.txt", I obtain


octave:2> [FNAME, FPATH, FLTIDX] = uiputfile ()
FNAME = toto.txt
FPATH = /home/myuser/Desktop/
FLTIDX =  1


Anonymous
Sun 18 Aug 2019 07:19:21 PM UTC, comment #5: 


комментарий №4:

> @davidblbulyan: what does "uiputfile ()" return when you select a file?

Did I understand correctly that instead of saving my schedule, I should choose an already saved one? If so, then it is not clear to me in what format the opened file should be, there in the list with the choice of formats there are only "octave figure file" and I do not have graphs in this format. And then, attach the output of what is being printed to the Octave console?
Well, for example, I opened the .jpg file and this is what appeared in the Octave console:

>> error: hgload: unable to locate file /home/david/Программы GNU Octave/untitled.jpg

execution error in graphics callback function

Blbulyan David <davidblbulyan>
Sun 18 Aug 2019 12:19:24 PM UTC, comment #4: 

@davidblbulyan: what does "uiputfile ()" return when you select a file?

Pantxo Diribarne <pantxo>
Group Member
Sun 18 Aug 2019 06:57:25 AM UTC, comment #3: 

This is what Octave writes to the console when trying to save a .svg file through a standard dialog:

octave-svgconvert infile fmt dpi font reconstruct outfile

Convert svg file to pdf, or svg. All arguments are mandatory:

  • infile: input svg file or "-" to indicate that the input svg fileshould be read from stdin
  • fmt: format of the output file. May be one of pdf or svg
  • dpi: device dependent resolution in screen pixel per inch
  • font: specify a file name for the default FreeSans font
  • reconstruct: specify wether to reconstruct triangle to polygons (0 or 1)
  • outfile: output file name

error: gl2ps_renderer::draw: internal pipe error
error: parse error
error: called from
    _opengl_print_ at line 193 column 7
    print at line 710 column 16
    saveas at line 110 column 3
    _add_default_menu_>__save_as__ at line 145 column 7
    _add_default_menu_>save_cb at line 126 column 5

>>

Blbulyan David <davidblbulyan>
Sun 18 Aug 2019 06:14:58 AM UTC, comment #2: 

I tried 'print -dsvg "path/to/fig1"' to append to the end of my file and it worked, but the standard dialog still doesn’t save the files on my Ubuntu 18.04 x64. I do not know what this is connected with. I also noticed that if you enter the .pdf extension, it saves everything perfectly, the format that was selected in the list is "Octave Figure File", and the extension I typed .pdf, it was also noticed that with the .jpg extension everything is saved, with the "Octave Figure File" format, I also noticed that .svg are not saved in this way. I will also attach a screenshot of the save dialog box to you so that you can understand which list with formats in question. I circled in red the very list with the formats in the screenshot.


Blbulyan David <davidblbulyan>
Sun 18 Aug 2019 05:00:22 AM UTC, comment #1: 

Thank you for your bug report.  With my Flatpak Octave 5.1 installation on openSUSE 15.1 I cannot reproduce the problem with your attached file #47356.  "Save as..." saves the desired figure to an arbitrary directory.  Even the Cyrillic chars are for most output formats no problem.

Can you try to create the figures from the Octave command line by entering the commands


print -djpg path/to/fig1
print -dsvg path/to/fig1
...


after running your script?

Kai Torben Ohlhus <siko1056>
Group Member
Sat 17 Aug 2019 07:02:40 PM UTC, original submission:  

Problems with exporting a chart from a chart window.
The problem manifests itself as follows: I am building a graph using the plot function, I select the "File" item in the main menu of this window with the graph, then "Save As" I enter the name and extension, regardless of which extension I entered, and even if it corresponds to the format that is separately selected in the same dialog box, the file is still not saved, well, that is, the dialog box when you click the Open button, yes yes, you have the Open button in the save dialog, instead of saving, and no, I did not confuse the menu items, if only because in this dialog box there is a field for entering the file name, well, if you click on this button, which is the “save” button, the dialog box closes without displaying any errors, as if everything was successful, but the file does not appear in the selected directory, I checked this is several times, and there is a problem even when the ascii characters are exclusively in the path to the file, that is, the problem clearly does not depend on the fact that some of my directories are named Cyrillic, which means it is something else. I have GNU Octave 5.1 Ubuntu 18.04, I installed Octave using flatpak, I apologize in advance for my English, well, like mine, for machine translation, English is not my native language, so if you see some bulky illogical constructions, it's not me, but Google Translate, if something is unclear, ask again, I will answer. Hope you fix this problem. P.S. Sorry about the long message.

Blbulyan David <davidblbulyan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by davidblbulyan (Submitted the item)
  • -email is unavailable- added by davidblbulyan
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-22 siko1056 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-08-20 davidblbulyan Attached File- Added Снимок@экрана@от@2019-08-20@21-34-20.png, #47370
    2019-08-20 pantxo StatusConfirmed Ready For Test
    2019-08-20 pantxo Item GroupNone Unexpected Error or Warning
        StatusNeed Info Confirmed
        Assigned toNone pantxo
        SummaryProblems with exporting a chart from a chart window. Unable to print SVG files when the path has spaces
    2019-08-18 pantxo CategoryGUI Plotting with OpenGL
    2019-08-18 davidblbulyan Attached File- Added Снимок@экрана@от@2019-08-18@09-09-40.png, #47361
    2019-08-18 siko1056 StatusNone Need Info
    2019-08-17 davidblbulyan Attached File- Added zatuhayuchie_colebania.m, #47356
        Carbon-Copy- Added davidblbulyan

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code