Skip to content

Commit

Permalink
Update parseOmeroMetadata method in ZarrReader.java to handle dif…
Browse files Browse the repository at this point in the history
…ferent types of numeric values correctly

* Check the type of the value before casting it to `Double`
* Convert `Integer` values to `Double` before further processing
  • Loading branch information
jo-mueller authored and dgault committed Aug 30, 2024
1 parent a1fbea5 commit 788f8d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,9 @@ private Number getDouble(Map<String, Object> src, String key) {
if (val == null) {
return null;
}
if (val instanceof Integer) {
return ((Integer) val).doubleValue();
}
return val.doubleValue();
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 788f8d7

Please sign in to comment.