Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix problem with some OSX not handling the cast on imDecode (#13207)
Browse files Browse the repository at this point in the history
  • Loading branch information
gigasquid committed Nov 10, 2018
1 parent 6ab06e6 commit 05dce1c
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 05dce1c

Please sign in to comment.