[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50797] uint8 RGB images trigger conversion er
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #50797] uint8 RGB images trigger conversion error |
Date: |
Fri, 21 Apr 2017 17:46:04 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Follow-up Comment #2, bug #50797 (project octave):
I get the same behavior reported error on the dev branch as well.
The actual error is generated in libinterp/octave-value/ov-intx.h.
Matrix
matrix_value (bool = false) const
{
Matrix retval;
dim_vector dv = dims ();
if (dv.ndims () > 2)
error ("invalid conversion of %s to Matrix", type_name ().c_str ());
retval = Matrix (dv(0), dv(1));
double *vec = retval.fortran_vec ();
octave_idx_type nel = matrix.numel ();
for (octave_idx_type i = 0; i < nel; i++)
vec[i] = matrix(i).double_value ();
return retval;
}
Somewhere in the code we are using object.matrix_value (). The issue is
probably that the code expects to see a 2-D color data matrix at that point
rather than a 3-D RGB value. I'm not sure whether the conversion is expected
to happen in C++ or in the m-file image.m.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50797>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/