Skip to content

Commit 7f1073f

Browse files
committed
BUGFIX: stop on non-matching res level
1 parent 9795ac9 commit 7f1073f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/cz/it4i/fiji/legacy/ReadFullImage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ Dataset readNow(final String url, final String datasetID,
160160
rangeSpatialY();
161161
rangeSpatialZ();
162162

163+
if (currentResLevel == null)
164+
throw new IOException("Cannot read at res level "+resolutionLevelsAsStr
165+
+" because the dataset is not having this one.");
166+
163167
return this.readWithAType();
164168
}
165169
}

src/main/java/cz/it4i/fiji/legacy/WriteFullImage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ void writeNow(final Img<TR> img, final String url, final String datasetID,
225225
rangeSpatialY();
226226
rangeSpatialZ();
227227

228+
if (currentResLevel == null)
229+
throw new IOException("Cannot write to res level "+resolutionLevelsAsStr
230+
+" because the dataset is not having this one.");
231+
228232
this.writeWithAType(image);
229233

230234
if (uploadResPyramids)

0 commit comments

Comments
 (0)