bugGNU Octave - Bugs: bug #35439, fltk printed png is restricted by...


bug #35439: fltk printed png is restricted by display size

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Thu 02 Feb 2012 07:53:36 PM UTC  
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Fri 18 Nov 2016 05:50:24 AM UTC, comment #11: 

The original examples work for me in Linux with 4.2.0.  Closing report.

Rik <rik5>
Project Administrator
Fri 14 Dec 2012 01:15:44 PM UTC, comment #10: 

If this is another example of the long-standing timing
problem in fltk it might be better to change the summary
to show this, and somehow try to track down the source
of this problem.  I have tried to isolate the problem,
but have not succeeded.

It is a serious defect that printed plots continue to be
rendered incorrectly.

Michael Godfrey <godfrey>
Project Member
Fri 14 Dec 2012 11:41:35 AM UTC, comment #9: 

No, I was too quick to draw a conclusion. The resizing command works with heights bigger than the displays height only  when the figure spreads over more than one workspaces. So this may be indeed a separate bug related to a fltk restriction. Probably there will be some workaround, but I am not very experienced in fltk.

Konstantinos Poulios <logari81>
Fri 14 Dec 2012 11:22:14 AM UTC, comment #8: 

I do not agree that this is a restriction of fltk/gl2ps.

If I comment out the setting of position in print.m:

 %    set (opts.figure, "position", fpos);

I can print the attached file with:

 fpos = get (gcf, "position");
 set (gcf, "position", [fpos(1),fpos(2),fpos(3),2000])
 print('-dpng', '/tmp/test.png')

Actually I suspect that this issue is just another manifestation of a race condition between fltk and octave, as I have described it in detail here:


Other manifestations of this fundamental bug are random output sizes depending e.g. if print is issued interactively or in a script or if "waits" and "drawnows" are added in the code.

Konstantinos Poulios <logari81>
Fri 17 Feb 2012 11:41:10 PM UTC, comment #7: 

A future toolkit, such as Qt, may fix this so, I've modified the status to "Postponed"

Ben Abbott <bpabbott>
Project Member
Fri 17 Feb 2012 01:45:48 AM UTC, comment #6: 

Changing the summary to better describe the problem.

Ben Abbott <bpabbott>
Project Member
Tue 14 Feb 2012 07:01:00 PM UTC, comment #5: 

I ran the script on both MacOS 10.7.3 and Ubuntu 10.04.  Nothing is garbled for me.

Ben Abbott <bpabbott>
Project Member
Tue 14 Feb 2012 05:02:50 PM UTC, comment #4: 

For me this is now all garbled (using your script with octave version 8de863b7126b tip). See attached.

Muhali <muhali>
Tue 14 Feb 2012 02:01:49 AM UTC, comment #3: 

I looked at this again. The problem for me is that my fltk window size is limited by my display. So when the print() command requests a window height of 1200 it is truncated.

To confirm I modified my script.

close all
toolkits = available_graphics_toolkits ();
canvas = fliplr (get (gcf, "paperposition") (3:4) * 72);
for t = 1:numel(toolkits)
  close all
  graphics_toolkit (toolkits{t})
  orient landscape
  print (sprintf ("foo-%s.png", toolkits{t}))
  print (sprintf ("bar-%s.png", toolkits{t}), sprintf ("-S%d,%d", canvas))

Both gnuplot and fltk give equivalent results.

I'm marking this as "won't fix" because this is a limitation imposed by the combination of fltk and gl2ps.

Ben Abbott <bpabbott>
Project Member
Mon 13 Feb 2012 10:47:33 PM UTC, comment #2: 

The interesting thing is that all depends on whether the commands are issued interactively (_i) or as the script (_s). I attach 4 files here only one of which gives the expected result, namely bar_s.png. Please note the slight difference at the bottom corner of foo.

Muhali <muhali>
Thu 02 Feb 2012 08:13:59 PM UTC, comment #1: 

I'll updated my sources.

$ hg tip
changeset:   14318:7dee2bb231c1
branch:      stable
tag:         tip
user:        Philip Nienhuis  <prnienhuis@users.sf.net>
date:        Thu Feb 02 10:46:52 2012 -0800
summary:     strread.m: Fix missing semicolon and unnecessary "unable to parse" messages (Bug #35418).

Gnuplot still works correctly, but now neither fltk plot is correct. The results are essentially the same, but the plot has retained the default aspect ratio.

Ben Abbott <bpabbott>
Project Member
Thu 02 Feb 2012 07:53:36 PM UTC, original submission:  

Using gnuplot, the example below gives me two plots what are each the correct size.

close all
graphics_toolkit fltk
orient landscape
print foo.png
print ("bar.png", sprintf ("-S%d,%d", 6*150, 8*150))

With fltk, the first is correct, but the 2nd is not. For me on MacOS X, the 2nd produces a sombrero with the proper aspect ratio, but it only fills the UL quadrant of 900 × 886 plot. The size should be 900 x 1200.

I'm running the default branch, and my tip is

$ hg tip
changeset:   14311:decea31ea010
branch:      stable
tag:         tip
user:        Ben Abbott  <bpabbott@mac.com>
date:        Mon Jan 30 08:22:32 2012 -0500
summary:     Fix qhull tests.

Ben Abbott <bpabbott>
Project Member


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

Attach Files:

Attached Files
file #27094:  test.png added by logari81 (12KiB - image/png - print higher than the display)
file #25063:  foo-fltk.png added by muhali (256KiB - image/png)
file #25064:  bar-fltk.png added by muhali (245B - image/png)
file #25065:  foo-gnuplot.png added by muhali (168KiB - image/png)
file #25066:  bar-gnuplot.png added by muhali (1KiB - image/png)
file #25056:  foo_i.png added by muhali (252KiB - image/png)
file #25057:  bar_i.png added by muhali (89KiB - image/png)
file #25058:  foo_s.png added by muhali (265KiB - image/png)
file #25059:  bar_s.png added by muhali (90KiB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by logari81 (Updated the item)
  • -email is unavailable- added by bpabbott (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-18 rik5 StatusPostponed => Fixed
        Open/ClosedOpen => Closed
    2012-12-14 logari81 StatusConfirmed => Postponed
    2012-12-14 logari81 Attached File- => Added test.png, #27094
        StatusPostponed => Confirmed
    2012-02-17 bpabbott StatusWont Fix => Postponed
    2012-02-17 bpabbott Summaryfltk printed png is the wrong size => fltk printed png is restricted by display size
    2012-02-14 muhali Attached File- => Added foo-fltk.png, #25063
        Attached File- => Added bar-fltk.png, #25064
        Attached File- => Added foo-gnuplot.png, #25065
        Attached File- => Added bar-gnuplot.png, #25066
    2012-02-14 bpabbott StatusNone => Wont Fix
    2012-02-13 muhali Attached File- => Added foo_i.png, #25056
        Attached File- => Added bar_i.png, #25057
        Attached File- => Added foo_s.png, #25058
        Attached File- => Added bar_s.png, #25059

    Back to the top

    Powered by Savane 3.5