Skip to content

Commit

Permalink
Fix problem with some OSX not handling the cast on imDecode (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
gigasquid authored and azai91 committed Dec 1, 2018
1 parent f4652bb commit ab3eea6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object Image {
def imDecode(buf: Array[Byte], flag: Int,
to_rgb: Boolean,
out: Option[NDArray]): NDArray = {
val nd = NDArray.array(buf.map(_.toFloat), Shape(buf.length))
val nd = NDArray.array(buf.map( x => (x & 0xFF).toFloat), Shape(buf.length))
val byteND = NDArray.api.cast(nd, "uint8")
val args : ListBuffer[Any] = ListBuffer()
val map : mutable.Map[String, Any] = mutable.Map()
Expand Down

0 comments on commit ab3eea6

Please sign in to comment.