diff --git a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/BytesConverter.scala b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/BytesConverter.scala index c0b3d229948..fa93de7f37c 100644 --- a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/BytesConverter.scala +++ b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/BytesConverter.scala @@ -38,17 +38,17 @@ object BytesConverter { case ZarrDataType.i8 | ZarrDataType.u8 => val arrayTyped = array.asInstanceOf[Array[Long]] val byteBuffer = makeByteBuffer(arrayTyped.length * bytesPerElement, byteOrder) - byteBuffer.asLongBuffer().put(arrayTyped).array() + byteBuffer.asLongBuffer().put(arrayTyped) byteBuffer.array() case ZarrDataType.f4 => val arrayTyped = array.asInstanceOf[Array[Float]] val byteBuffer = makeByteBuffer(arrayTyped.length * bytesPerElement, byteOrder) - byteBuffer.asFloatBuffer().put(arrayTyped).array() + byteBuffer.asFloatBuffer().put(arrayTyped) byteBuffer.array() case ZarrDataType.f8 => val arrayTyped = array.asInstanceOf[Array[Double]] val byteBuffer = makeByteBuffer(arrayTyped.length * bytesPerElement, byteOrder) - byteBuffer.asDoubleBuffer().put(arrayTyped).array() + byteBuffer.asDoubleBuffer().put(arrayTyped) byteBuffer.array() } } diff --git a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/ZarrHeader.scala b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/ZarrHeader.scala index bf19fc0c0c6..c0422e1e631 100644 --- a/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/ZarrHeader.scala +++ b/webknossos-datastore/app/com/scalableminds/webknossos/datastore/jzarr/ZarrHeader.scala @@ -9,6 +9,7 @@ import com.scalableminds.webknossos.datastore.jzarr.DimensionSeparator.Dimension import com.scalableminds.webknossos.datastore.jzarr.ZarrDataType.ZarrDataType import com.scalableminds.webknossos.datastore.models.datasource.{DataLayer, ElementClass} import net.liftweb.common.Box.tryo +import play.api.libs.json.Json.WithDefaultValues import play.api.libs.json._ case class ZarrHeader( @@ -133,7 +134,7 @@ object ZarrHeader { implicit object ZarrHeaderFormat extends Format[ZarrHeader] { override def reads(json: JsValue): JsResult[ZarrHeader] = - Json.reads[ZarrHeader].reads(json) + Json.using[WithDefaultValues].reads[ZarrHeader].reads(json) override def writes(zarrHeader: ZarrHeader): JsValue = Json.obj(