bugGNU Octave - Bugs: bug #39926, imagesc renders figure incomplete,...

 
 

bug #39926: imagesc renders figure incomplete, plus the figure is not printed

Submitter:  Muhali <muhali>
Submitted:  Tue 03 Sep 2013 10:18:15 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 12 Sep 2013 01:54:57 PM UTC, comment #4: 


> Which solution did you use? Did you compile ghostscript from source?


I compiled from the most recent git repository.

> Does it work for the original value of 40,000?


No. I see a small white band at the right side, near 95% roughly.

Muhali <muhali>
Thu 12 Sep 2013 01:47:18 PM UTC, comment #3: 

Which solution did you use?  Did you compile ghostscript from source?

The string that is the problem is rgbstr which is roughly 3X the number of elements in the image.  For my unhacked copy of ghostscript I need to keep the number of elements below about 65535/3 or about 21,800.

Does it work for the original value of 40,000?  It could be that there are new errors that you are discovering.  Again, I don't think they are likely to be in Octave.  Rather they are probably in gl2ps or ghostscript.

Rik <rik5>
Group administrator
Thu 12 Sep 2013 10:55:38 AM UTC, comment #2: 

Rik, I did what you suggested but still see the behavior originally reported. It prints without error now, but the image is either too large or too small (see attached images).

For small and large I use, respectively,


imagesc(ones(1, 59000))



imagesc(ones(1, 58000))


but that seems to vary randomly. For example, using the number 60000 sometimes the figures are too large and sometimes too small.


Muhali <muhali>
Tue 10 Sep 2013 04:22:11 PM UTC, comment #1: 

This isn't an Octave bug, but rather a ghostscript or gl2ps bug.  The problem is that rgbstr is 120,000 elements and the maximum size for a string is 65535.  See the table Architectual Limits 3.1 in the Ghostscript documentation (http://ghostscript.com/doc/8.54/Language.htm)

ghostscript sources have been patched to increase the maximum string length in Aug. 2012 (http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=86f9af6937e76e10a7adad201b06c337b1a9240b).  So you could always build from source to get a ghostscript that works.  Eventually this will trickle down into Linux distributions as well.

Alternatively, gl2ps could be hacked to use .bytestring rather than string which does not have a limit on size.  However, that would make the output ghostscript-specific, rather than PostScript compliant, which is probably not a good thing.

Rik <rik5>
Group administrator
Tue 03 Sep 2013 10:18:15 AM UTC, original submission:  


imagesc(ones(1, 40000))


gives the figure attached. When trying to print as png I get

Error: /limitcheck in --string--
Operand stack:
   --nostringval--   rgbstr   120000
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   --nostringval--   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1165/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--   --dict:40/64(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.06: Unrecoverable error, exit code 1
warning: broken pipe

Muhali <muhali>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29119:  small.png added by muhali (10KiB - image/png)
file #29120:  large.png added by muhali (9KiB - image/png)
file #28989:  foo.png added by muhali (9KiB - 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 muhali (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
    2013-09-12 muhali Attached File- Added small.png, #29119
        Attached File- Added large.png, #29120
    2013-09-10 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-09-03 muhali Attached File- Added foo.png, #28989

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code