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


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

Submitted by:  Muhali <muhali>
Submitted on:  Tue Sep 3 10:18:15 2013  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Thu Sep 12 13:54:57 2013, 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 Sep 12 13:47:18 2013, 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>
Project Administrator
Thu Sep 12 10:55:38 2013, 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,

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

(file #29119, file #29120)

Muhali <muhali>
Tue Sep 10 16:22:11 2013, 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>
Project Administrator
Tue Sep 3 10:18:15 2013, original submission:

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

Attached Files
file #29119:  small.png added by muhali (10kB - image/png)
file #29120:  large.png added by muhali (9kB - image/png)
file #28989:  foo.png added by muhali (9kB - image/png)


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 muhali (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
    Thu Sep 12 10:55:38 2013muhaliAttached File-=>Added small.png, #29119
      Attached File-=>Added large.png, #29120
    Tue Sep 10 16:22:11 2013rik5StatusNone=>Invalid
    Tue Sep 3 10:18:15 2013muhaliAttached File-=>Added foo.png, #28989

    Back to the top

    Powered by Savane 3.1-cleanup