From 788f8d7349e8742fac2214e5c32bca69993c5d56 Mon Sep 17 00:00:00 2001 From: Johannes Soltwedel <38459088+jo-mueller@users.noreply.github.com> Date: Wed, 14 Aug 2024 09:08:28 +0200 Subject: [PATCH] Update `parseOmeroMetadata` method in `ZarrReader.java` to handle different types of numeric values correctly * Check the type of the value before casting it to `Double` * Convert `Integer` values to `Double` before further processing --- src/loci/formats/in/ZarrReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/loci/formats/in/ZarrReader.java b/src/loci/formats/in/ZarrReader.java index 1ecc111..64c5a2e 100644 --- a/src/loci/formats/in/ZarrReader.java +++ b/src/loci/formats/in/ZarrReader.java @@ -1116,6 +1116,9 @@ private Number getDouble(Map src, String key) { if (val == null) { return null; } + if (val instanceof Integer) { + return ((Integer) val).doubleValue(); + } return val.doubleValue(); } @@ -1204,7 +1207,7 @@ public boolean quickRead() { } return QUICK_READ_DEFAULT; } - + /** * Used to decide if images stored in the label sub folder should be included in the list of images * @return boolean true if images in the label folder should be included, default is false