|
From: Daniel J S. <dan...@ie...> - 2006-02-21 08:09:09
|
Daniel J Sebald wrote:
> Petr Mikulik wrote:
>
>>>> Attached is a patch to fix this bug. It uses a bisecting method.
>>>> Please check it over and test it. You'll find that the
>>>> imshow(A,A,A) now works but doesn't look to be the correct
>>>> brightness. We'll address that problem next.
>>
>>
>>
>> OK, now the patch, gnuplot does not crash.
>>
>> On the other hand, it shows the following garbage:
>>
>> octave|3> A = loadimage ("default.img");
>> octave|4> imshow(A,A,A);
>> gnuplot_x11: unknown command
>> <.'.'.'<.<.<.>/>/>/$@0@0@0,@0@0@03@0@0@0;@0@0@0C@p@p@pJ@p@p@pR@p@p@pZ?p?p?pb>o>o>oi<n<n<nq9m9m9my:m:m:m:m:m:m8l8l8l8l8l8l9,9,9,9m9m9m
I think I found this little easter egg. After printing out tons of stuff I finally saw this for the buffer offset:
buff_offset = 0
i = 1250
buff_offset = 0
i = 1300
buff_offset = 193
DONE PAL
what is a makepal
total_chars = 6785
buff_offset = 0
This is from comments added to the hunk of 50 palette values sent through the pipe, and somewhere around the 1300 value the pipe paused for other traffic (the middle three lines came from the core fprintf) and only a partial buffer (buff_offset = 193) was read. So, the shorter palettes were generally making it through in time, but not this longer one.
In the palette code there were these comments:
read_input(); /* FIXME: discarding status */
which means that when a partial read was done the code continued on its merry way. The partial read didn't advance the buffer, so there was all kinds of garbage left at the end.
Patch attached.
There is also the bug fix for the interpolation, with a ChangeLog comment.
Could someone please add these and then let me know when CVS has been updated.
Thank you,
Dan
|