two bugs in one (rgb2color & bug_report)
Ben Abbott
bpabbott at mac.com
Sat Jun 6 22:19:17 CDT 2009
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
More information about the Bug-octave
mailing list