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

 
 

bug #31884: fltk print problem

Submitted by:  Daisuke TAKAGO <takago>
Submitted on:  Wed 15 Dec 2010 05:24:57 AM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: takagoOpen/Closed: Closed
Release: devOperating System: GNU/Linux

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 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>
Project 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>
Project 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>
Project 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>
Project 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 ...

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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by takago (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Mar 2011 03:45:02 PM UTCbpabbottStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Fri 18 Mar 2011 06:23:01 AM UTCrik5StatusReady For Test=>Need Info
    Mon 20 Dec 2010 06:10:58 PM UTCbpabbottStatusWorks For Me=>Ready For Test
    Sun 19 Dec 2010 01:54:18 AM UTCbpabbottStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1