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

[Scala][Clojure] Fix problem with some OSX not handling the cast on imDecode #13207

Merged
merged 1 commit into from
Nov 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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