You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing the file from curated/quicktime/qa-11074 into OMERO succeeds and the first 3 planes can be viewed, but subsequent planes fail to display with errors like this in the logs:
java.lang.NullPointerException: null
at loci.formats.in.NativeQTReader.openBytes(NativeQTReader.java:231)
at loci.formats.DelegateReader.openBytes(DelegateReader.java:227)
at loci.formats.ImageReader.openBytes(ImageReader.java:465)
at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:167)
at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:159)
at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:200)
at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348)
at ome.io.bioformats.BfPixelsWrapper.getTile(BfPixelsWrapper.java:350)
at ome.io.bioformats.BfPixelBuffer.getTile(BfPixelBuffer.java:499)
I could not immediately reproduce this with showinf or showinf -cache. Some simple test code does show the same exception though:
$ cat Test.java
import java.util.Arrays;
import loci.formats.ImageReader;
import loci.formats.Memoizer;
public class Test {
public static void main(String[] args) throws Exception {
try (ImageReader r = new ImageReader()) {
r.setId(args[0]);
for (int i=0; i<r.getImageCount(); i++) {
Memoizer m = new Memoizer();
m.setId(args[0]);
byte[] regularPlane = r.openBytes(i);
byte[] memoPlane = m.openBytes(i);
System.out.println("plane #" + i + " equal: " + Arrays.equals(regularPlane, memoPlane));
}
}
}
}
$ java Test hekdfcpgfpmcherry2xfyvelivestarve_p0.mov
The source of the issue seems to be that the prevPixels array in NativeQTReader (QTReader in 7.0.0+) changes after every openBytes - as expected, this is for handling the case when the stored plane is actually the difference between the current and previous planes. However, updates to prevPixels do not get written back to the memo file - also more or less as expected. This means that prevPixels can be in the wrong state for a given plane when the Memoizer is reinitialized on every plane read.
This may be slightly tricky to fix; getting prevPixels into the correct state for a particular plane can require reading all previous planes.
As far as I can tell, this was not recently introduced, and has likely been a problem for a long time. We might want to consider adding a repository test that demonstrates this use case.
The text was updated successfully, but these errors were encountered:
Importing the file from
curated/quicktime/qa-11074
into OMERO succeeds and the first 3 planes can be viewed, but subsequent planes fail to display with errors like this in the logs:I could not immediately reproduce this with
showinf
orshowinf -cache
. Some simple test code does show the same exception though:The source of the issue seems to be that the
prevPixels
array inNativeQTReader
(QTReader
in 7.0.0+) changes after everyopenBytes
- as expected, this is for handling the case when the stored plane is actually the difference between the current and previous planes. However, updates toprevPixels
do not get written back to the memo file - also more or less as expected. This means thatprevPixels
can be in the wrong state for a given plane when theMemoizer
is reinitialized on every plane read.This may be slightly tricky to fix; getting
prevPixels
into the correct state for a particular plane can require reading all previous planes.As far as I can tell, this was not recently introduced, and has likely been a problem for a long time. We might want to consider adding a repository test that demonstrates this use case.
The text was updated successfully, but these errors were encountered: