From 5558cfbad517c0ff043a5d27f29bcfefc82268db Mon Sep 17 00:00:00 2001 From: tiagohm Date: Mon, 1 Apr 2024 19:51:13 -0300 Subject: [PATCH] [api]: Fix "Missing bounds Image attribute" --- nebulosa-xisf/src/main/kotlin/nebulosa/xisf/XisfFormat.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nebulosa-xisf/src/main/kotlin/nebulosa/xisf/XisfFormat.kt b/nebulosa-xisf/src/main/kotlin/nebulosa/xisf/XisfFormat.kt index 308cda3ec..6ce39ef86 100644 --- a/nebulosa-xisf/src/main/kotlin/nebulosa/xisf/XisfFormat.kt +++ b/nebulosa-xisf/src/main/kotlin/nebulosa/xisf/XisfFormat.kt @@ -97,11 +97,13 @@ data object XisfFormat : ImageFormat { val bitpix = hdu.header.bitpix val sampleFormat = SampleFormat.from(bitpix) val imageSize = hdu.width * hdu.height * hdu.numberOfChannels * sampleFormat.byteLength + val extra = if (bitpix.code < 0) " bounds=\"0:1\"" else "" IMAGE_START_TAG .format( hdu.width, hdu.height, hdu.numberOfChannels, - sampleFormat.code, colorSpace.code, imageType.code, initialHeaderSize, imageSize + sampleFormat.code, colorSpace.code, imageType.code, + initialHeaderSize, imageSize, extra ).also(buffer::writeUtf8) for ((name, key) in AstronomicalImageProperties) { @@ -196,7 +198,7 @@ data object XisfFormat : ImageFormat { """""" private const val XISF_END_TAG = "" private const val IMAGE_START_TAG = - """""" + """""" private const val IMAGE_END_TAG = "" private const val STRING_PROPERTY_TAG = """%s""" private const val NON_STRING_PROPERTY_TAG = """"""