two bugs in one (rgb2color & bug_report)

Jaroslav Hajek highegg at gmail.com
Sun Jun 7 01:59:20 CDT 2009


On Sun, Jun 7, 2009 at 5:19 AM, Ben Abbott<bpabbott at mac.com> wrote:
>
> On Jun 5, 2009, at 7:20 AM, Ben Abbott wrote:
>
>> The bug_report function failed for me today (I think this has already
>> been reported, but if not ... )
>>
>> The bug I wanted to report was ...
>>
>> --------------------
>> octave:6> h = plot (1:10)
>> octave:7> set (h, "color", rgb2gray (get (h, "color")))
>> error: invalid value for color property "color"
>> --------------------
>>
>> However, the following command works.
>>
>> --------------------
>> octave:8> set (h, "color", mean (get (h, "color"), 2) * [1 1 1])
>> --------------------
>>
>> Digging a bit more
>>
>> --------------------
>> octave:9> rgb = get (h, "color"); whos rgb
>> Variables in the current scope:
>>
>>  Attr Name        Size                     Bytes  Class
>>  ==== ====        ====                     =====  =====
>>       rgb         1x3                         24  double
>>
>> Total is 3 elements using 24 bytes
>>
>> octave:10> gray = rgb2gray (get (h, "color")); whos gray
>> Variables in the current scope:
>>
>>  Attr Name        Size                     Bytes  Class
>>  ==== ====        ====                     =====  =====
>>       gray        1x3                         24  double
>>
>> Total is 3 elements using 24 bytes
>>
>> octave:11> gray
>> gray =
>>
>>    0.33333    0.33333    0.33333
>> --------------------
>>
>> I'm at a loss to see why the 1x3 double from rgb2gray is an invalid
>> color value.
>>
>> When I tried bug_report ...
>>
>> --------------------
>> bug_report
>> Please enter a one-line description of your bug report.
>>
>> Subject: rgb2color produces an invalid color value
>> sh: octave-bug-3.1.55: command not found
>> --------------------
>>
>> John/Jaroslav,
>>
>> If it is not already too late, should the bug_report problem be
>> resolved prior to the 3.2 release.
>>
>> Ben
>
> I've experimented more. Using full() resolves the problem
>
>        octave:6> h = plot (1:10)
>        octave:7> set (h, "color", full (rgb2gray (get (h, "color"))))
>
> But
>
>        octave:8> issparse(rgb2gray (get (h, "color")))
>        ans = 0
>
> It looks to me like there is a low level problem.
>
> Ben
>
>

Yes. The catch was that rgb2gray can produce a range, a "set" was not
ready for it.  Fixed. Btw, I would appreciate an explicit alert when
you use an external package function (rgb2gray) in a bug report for
Octave.

regarding bug_report, it only works when Octave is installed using
"make install", is that your case? if yes, I don't know what's failing
for you.

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Bug-octave mailing list