SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.37k stars 192 forks source link

Fixes #457 Bitmap.ToArray() does not handle images with odd width #458

Closed AmbachtIT closed 3 years ago

AmbachtIT commented 3 years ago

This PR fixes #457 by separating the projection from 1D to a 4D array first and slicing out the correct size afterward if the width of the supplied image is not even.

Please note: This is my first Github PR ever. Please be gentle ;).

AmbachtIT commented 3 years ago

I have discovered a similar error in NDArray.ToBitmap(). I'll combine both fixes in a single PR. Closing this one.