Skip to content

Commit

Permalink
Warn if relative units are encountered for a physical length
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Sep 13, 2024
1 parent ab8234f commit c7e9161
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/formats-bsd/src/loci/formats/out/DicomWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,12 @@ private short[] makeShortArray(int v) {
* proper physical units (e.g. mm), so need to be handled specially.
*/
private Length fixUnits(Length size) {
if (size == null || size.unit() == UNITS.PIXEL || size.unit() == UNITS.REFERENCEFRAME) {
if (size == null) {
return null;
}
if (size.unit() == UNITS.PIXEL || size.unit() == UNITS.REFERENCEFRAME) {
LOGGER.warn("Found physical length '{}' in relative units '{}'; this value will be lost",
size.value(), size.unit());
return null;
}
return size;
Expand Down

0 comments on commit c7e9161

Please sign in to comment.