Bitmap.ToArray() does not handle images with odd width
AmbachtIT opened this issue · 0 comments
AmbachtIT commented
Reproduction
- Have an image with an odd width (for instance: 475x554x3)
- Load it into an
NDArray
usingBitmap.ToNDArray()
;
Expected result
- An array with shape (1, 554, 475, 3)
Actual result
- throws
IncorrectShapeException
: Given shape size (789450) does not match the size of the given storage size (791112)
Root cause
- The method
ToNDArray()
does not handle odd shapes correctly.
Fix
- I have been able to reproduce the problem locally and implement a fix. PR will be following shortly.