bugGNU Octave - Bugs: bug #31884, fltk print problem

 
 

bug #31884: fltk print problem

Submitter:  Daisuke TAKAGO <takago>
Submitted:  Wed 15 Dec 2010 05:24:57 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  takago Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Mar 2011 03:45:02 PM UTC, comment #18: 

I'm closing this report. If the problem persists it  an be reopened.


Ben Abbott <bpabbott>
Group Member
Fri 18 Mar 2011 06:23:01 AM UTC, comment #17: 

Can this bug be closed now?  The last action was to confirm that Ben's patch worked and it is now 3 months later.  Presumably it does work and this can be closed.

Rik <rik5>
Group administrator
Tue 28 Dec 2010 12:28:21 PM UTC, comment #16: 

Daisuke,

If it is more convenient, you can install Ubuntu with VirtualBox.

    http://www.virtualbox.org/

Ben

Ben Abbott <bpabbott>
Group Member
Tue 28 Dec 2010 06:23:25 AM UTC, comment #15: 

Ben,

Thank you for help.
In my work room, there are some type of PC. So, I will install Ubuntu 10.04 and check octave-dev. When I noticed something, I will post a cooment immediately.

Daisuke


Daisuke TAKAGO <takago>
Sat 25 Dec 2010 11:39:28 PM UTC, comment #14: 

Daisuke,

Using your script on MacOS 10.6.5 and on Ubuntu 10.04, I get the proper size for all png files.

I have little insight into what might be causing the problem.

Do you have any thoughts on why your experience is different?

Ben

Ben Abbott <bpabbott>
Group Member
Sat 25 Dec 2010 02:31:24 AM UTC, comment #13: 

Ben,

>> After pulling the changeset, are the png files produced all the same size?


No.
After pulling your changeset, the png files are not produced all the same size. The image size changes alternately.


>> If the script works correctly for you, the figure window with both flicker and change size. This is necessary as printing for the OpenGL backend requires that the figure be rendered with the same number of pixels as the desired output. Thus, the resolution/size of the figure is temporarily changed.


Okay. I understood that flicker and temporary image resizing are natural things for printing with the OpenGL backend.

Daisuke TAKAGO <takago>
Fri 24 Dec 2010 02:41:24 PM UTC, comment #12: 

Daisuke,

I should have worded my question from Dec 21 differently, I asked ...


After pulling the changeset, are your plots all the correct size?


I should have asked

After pulling the changeset, are the png files produced all the same size?

If the script works correctly for you, the figure window with both flicker and change size. This is necessary as printing for the OpenGL backend requires that the figure be rendered with the same number of pixels as the desired output. Thus, the resolution/size of the figure is temporarily changed.

Ben Abbott <bpabbott>
Group Member
Fri 24 Dec 2010 06:10:31 AM UTC, comment #11: 


Hi, Ben.
(Sorry for my late reply. I got a cold and was in bed.)

After pulling your changeset,
The following code occurs flicker and changing size each time through the loop.

 %test1
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 drawnow
 eval(sprintf('print -dpng /tmp/%03d.png',f))
 end
 
-----------------------------
 when i remove "drawnow", it redraws the figure window  each time through the loop.
 it does not occur flicker and changing size.
 
 %test2
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 eval(sprintf('print -dpng /tmp/%03d.png',f))
 end

-----------------------------
when i remove "print" , it works well.

 %test3
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 drawnow
 end

--------------------------------
when i remove "print" and "drawnow" , it shows the last image only.

 %test4
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 end

 --------------------------------
when i replace "drawnow" to "pasue(1)", it occurs flicker and changing size each time through the loop.
"pause(1)" does not work. it finished soon.

 %test5
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 pause(1)
 eval(sprintf('print -dpng /tmp/%03d.png',f))
 end

 --------------------------------
when i replace "drawnow" to "pasue(1)", and remove "print".  it redraws the figure window  each time through the loop.
"pause(1)" works well. it takes about 20 sec.

 %test6
 figure(1);
 for f=1:20
 image(floor(255*rand(32,64)));
 colormap(gray(256));
 axis image
 axis off
 pause(1)
 end

-------
Daisuke

Daisuke TAKAGO <takago>
Wed 22 Dec 2010 12:52:07 PM UTC, comment #10: 

I'd assumed that _fltk_redraw_ would fix the problem.

What happens if you remove "drawnow" from your script?

Does it help to add "pause(1)" in place of "drawnow"?


Ben Abbott <bpabbott>
Group Member
Wed 22 Dec 2010 04:06:59 AM UTC, comment #9: 

Ben,

>> After pulling the changeset, are your plots all the correct size?



No. There is no difference between before and after. It occurs fliker and changing image size.

Daisuke TAKAGO <takago>
Tue 21 Dec 2010 12:55:58 PM UTC, comment #8: 

Daisuke,

After pulling the changeset, are your plots all the correct size?

Ben

Ben Abbott <bpabbott>
Group Member
Tue 21 Dec 2010 03:41:02 AM UTC, comment #7: 


>> After pulling your changeset, I still see the fltk figure window changing size each time through the loop.


me,too. it occurs fliker and changing image size.

Daisuke TAKAGO <takago>
Mon 20 Dec 2010 06:41:23 PM UTC, comment #6: 

My recollection is that GL2PS required the figure to be rendered with the intended size, with vector formats requiring the output height/width in pixels to be mirrored by he displayed figure height/width in pixels.

Using FLTK-1.1.10-aqua the window has always changed size for me. I hadn't realized others did not see this effect.



Ben Abbott <bpabbott>
Group Member
Mon 20 Dec 2010 06:31:53 PM UTC, comment #5: 

After pulling your changeset, I still see the fltk figure window changing size each time through the loop.

John W. Eaton <jwe>
Group administrator
Mon 20 Dec 2010 06:10:36 PM UTC, comment #4: 

I've pushed a changeset.

http://hg.savannah.gnu.org/hgweb/octave/rev/f1a4db353da5

Please test and give feedback.

Ben Abbott <bpabbott>
Group Member
Mon 20 Dec 2010 07:10:57 AM UTC, comment #3: 

In my environment the convination of "drawnow" and "print" occurs flicker. --> http://pegasus.infor.kanazawa-it.ac.jp/~takago/out.mpg

Daisuke TAKAGO <takago>
Mon 20 Dec 2010 06:25:47 AM UTC, comment #2: 

Hello, Ben.

>> I tried the example on MacOSX. The resolution for each picture is the same. Perhaps we're using different versions of FLTK? I'm running FLTK 1.1.10. What version of FLTK are you using?


I'm using fltk 1.1.10 (included in Debian/Squeeze package).

>> Also, what happens if you replace drawnow with fltk_redraw?


When I replaced drawnow with fltk_redraw, it worked well. All generated images have same size.

Daisuke TAKAGO <takago>
Sun 19 Dec 2010 01:54:18 AM UTC, comment #1: 

I tried the example on MacOSX. The resolution for each picture is the same.

Perhaps we're using different versions of FLTK?

I'm running FLTK 1.1.10. What version of FLTK are you using?

Also, what happens if you replace drawnow with _fltk_redraw_?


Ben Abbott <bpabbott>
Group Member
Wed 15 Dec 2010 05:24:57 AM UTC, original submission:  

The following program generates 20 pictures. In my environment the image size of odd numbered pictures is 1200x900, although even numbered pictures is 1167x875. Is this a bug?

--- FROM HERE
figure(1);
for  f=1:20
      image(floor(255*rand(32,64)));
      colormap(gray(256));
      axis image
      axis off
      drawnow
      eval(sprintf('print  -dpng /tmp/%03d.png',f))
end
--- END HERE

Daisuke TAKAGO <takago>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 jwe (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by takago (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-18 bpabbott StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2011-03-18 rik5 StatusReady For Test Need Info
    2010-12-20 bpabbott StatusWorks For Me Ready For Test
    2010-12-19 bpabbott StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code