bugGNU Octave - Bugs: bug #52303, printing "demo getframe...


bug #52303: printing "demo getframe 2" results in emtpy figure

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Sun 29 Oct 2017 05:53:04 AM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sun 11 Nov 2018 12:38:55 PM UTC, comment #17: 

Ah... Thx Panxto that is helpful.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 11 Nov 2018 02:11:48 AM UTC, comment #16: 

@Philip: Yes, you can't see any added title or xlabel/ylabel because the axes object has been resized to cover the entire area of the figure.  To see what I mean, try this code line by line.

demo getframe 2
title ('my title')  # title will not be visible
set (gca, 'position', [0, 0, 1, 0.9])  # NOW it is visible

Rik <rik5>
Group administrator
Sat 10 Nov 2018 03:26:18 PM UTC, comment #15: 

Sure I'll do.
I noted I that the figure left by "demo getframe 2" doesn't accept title and ylabel/xlabel strings. Is that as designed?

Philip Nienhuis <philipnienhuis>
Group Member
Wed 07 Nov 2018 09:25:17 PM UTC, comment #14: 

This is due to svgconvert, introduced in bug #52193 (still open for tests). Can you add your failing test case there?

Pantxo Diribarne <pantxo>
Group Member
Wed 07 Nov 2018 09:16:20 PM UTC, comment #13: 

Ran a build while performing other duties, from hg id 26054 (920a4ad8043b) "remove called_from_builtin"

<demo figure 2>   ## runs fine
>> print("t1b.svg")
Unable to add default font to database

... so this feels like a regression :-(

Reopen this bug or some other?

Philip Nienhuis <philipnienhuis>
Group Member
Wed 07 Nov 2018 06:52:45 PM UTC, comment #12: 

26029 (390d59717711) adding a toolbar with common browse tools to the doc browser (bug 54938)

I'll make a new cross-build soon, when depends a bit on various duties in my other life besides Octave:-)

Philip Nienhuis <philipnienhuis>
Group Member
Tue 06 Nov 2018 08:18:03 PM UTC, comment #11: 

@Philip: Out of curiosity what is the hg id of your build? A new svgconvert option, which is used by default by the SVG device, has recently been introduced and I wanted to know if it worked fine on windows.

Pantxo Diribarne <pantxo>
Group Member
Tue 06 Nov 2018 07:14:17 PM UTC, comment #10: 

FTR, "demo getframe 2" (see original report) now works in Windows with recent dev Octave. Printing to .svg and .png gives proper figure files.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 06 Nov 2018 04:36:11 PM UTC, comment #9: 

This works for me with png format.  I can't test with SVG because I am getting this warning:

GL2PS warning: GL2PS must be compiled with PNG support in order to embed images in SVG streams

I probably need to download the gl2ps source code and compile it myself.

I'll still mark this bug as fixed though and close it.

Rik <rik5>
Group administrator
Tue 06 Nov 2018 12:45:57 PM UTC, comment #8: 

I think recent changes in image clipping handling should have fixed this (at least it does for me). Can someone confirm so that I can close this report?

Pantxo Diribarne <pantxo>
Group Member
Tue 06 Feb 2018 02:49:40 PM UTC, comment #7: 

@Dan: the png support is only needed for svg output. gl2ps uses libpng to convert pixel data into png and pass them as a base64 stream to the url attribute of an image element. See e.g. https://stackoverflow.com/questions/6249664/does-svg-support-embedding-of-bitmap-images#6250418

Pantxo Diribarne <pantxo>
Group Member
Mon 05 Feb 2018 11:06:41 PM UTC, comment #6: 

Yes both png and svg are empty files (png is filled with 0, so it has
non -zero size).


Dmitri A. Sergatskov <dasergatskov>
Mon 05 Feb 2018 10:53:56 PM UTC, comment #5: 

Dmitri, you wrote "The same with png output."  Are you also seeing a blank output for the PNG files?

I'm getting the following odd behavior:

octave:6> graphics_toolkit qt
octave:7> clf reset;
octave:8> contourf (rand (5));
octave:9> frame = getframe (gcf ());
octave:10> imshow (frame.cdata);
octave:11> set (gca, "position", [0 0 1 1]);
octave:12> print("t1.svg")
GL2PS warning: GL2PS must be compiled with PNG support in order to embed images in SVG streams
octave:13> print("t1.png")
octave:14> exit

The t1.png file looks fine.  But I don't understand the warning message about GL2PS needing PNG support, given that I saved the plot in PNG format.  Could it be a poorly initialized input variable for one of the gl2ps routines?

Dan Sebald <sebald>
Fri 10 Nov 2017 05:40:01 AM UTC, comment #4: 

More confirmation that this is some OpenGL oddity.  The following works:

set (gca, 'position', [0+eps(1,'single'), 0, 1,1])

The fact that it has to the eps for a single value is an indication that OpenGL, which works with single precision numbers, is involved.

Rik <rik5>
Group administrator
Mon 30 Oct 2017 04:15:46 AM UTC, comment #3: 

This is probably something to do with clipping.  Maybe there is someplace where '<' was used when '<=' was intended.

For example, If I change the position statement to

set (gca, 'position', [0 0 1.0 .999])

then I get a printout.

Rik <rik5>
Group administrator
Mon 30 Oct 2017 12:03:12 AM UTC, comment #2: 

set (gca, "position", [0 0 1 1]);

At least on Fedora and current dev system it is the
line above that causes the blank print (also as .pdf)

Michael Godfrey <godfrey>
Group Member
Sun 29 Oct 2017 10:43:27 PM UTC, comment #1: 

Confirmed on Windows as well.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 29 Oct 2017 05:53:04 AM UTC, original submission:  

octave:1> demo getframe 2
getframe example 2:
 clf reset;
 contourf (rand (5));
 frame = getframe (gcf ());
 imshow (frame.cdata);
 set (gca, "position", [0 0 1 1]);

octave:2> print("t1.svg")

The result is essentially empty frame. The same with png output.
(svg is attached).

7dd3ab97ccd5+ tip @


Dmitri A. Sergatskov <dasergatskov>


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

Attach Files:

Attached Files
file #42288:  t1.svg added by dasergatskov (652B - image/svg+xml)


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 sebald (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-06 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-11-06 pantxo StatusConfirmed Ready For Test
    2017-10-29 philipnienhuis StatusNone Confirmed
        Operating SystemGNU/Linux Any
    2017-10-29 dasergatskov Attached File- Added t1.svg, #42288

    Back to the top

    Powered by Savane 3.13-9c15.
    Corresponding source code