Ticket #1 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

Leica Reader openBytes() Exception

Reported by: callan Owned by: somebody
Priority: minor Milestone:
Component: bio-formats Severity:
Keywords: Cc:
Blocked By: Blocking:


The Leica reader currently throws and exception when the openBytes(String id, int no, byte[] buf) method is called.

Change History

comment:1 Changed 13 years ago by callan

Basic test code:

package ome.formats.importer;

import java.io.IOException;

import loci.formats.FormatException;
import loci.formats.ImageReader;

public class LeicaTester
        public static final String FILENAME =
        public static void main(String[] args)
                throws FormatException, IOException
                ImageReader reader = new ImageReader();
                byte[] buffer = new byte[65536];
                reader.openBytes(FILENAME, 0, buffer);
                System.err.println("Length: " + buffer.length);


Exception in thread "main" java.lang.NullPointerException
	at loci.formats.in.BaseTiffReader.openBytes(BaseTiffReader.java:719)
	at loci.formats.ImageReader.openBytes(ImageReader.java:361)
	at ome.formats.importer.LeicaTester.main(LeicaTester.java:16)

comment:2 Changed 13 years ago by callan

Changes made in r2351 (the commenting out of the openBytes(String id, int no, byte[] buf) method basically) cause any method calls to openBytes(String id, int no, byte[] buf) to be handled by the superclass BaseTiffReader. As no initFile() has been performed in the context of the LeicaReader instance, the NullPointerException is thrown.

comment:3 Changed 13 years ago by melissa

  • Status changed from new to closed
  • Resolution set to fixed

comment:4 Changed 13 years ago by callan

Tying this in with the changeset that fixes the issue: r2437.

comment:5 Changed 13 years ago by curtis

  • Component changed from component1 to bio-formats
Note: See TracTickets for help on using tickets.