openmicroscopy/bioformats — pull request #626 by joshmoore (2013-08-04 19:42:35+00:00)
Title: Make BufferedImage transient in ImageIOReader (Fix #11334)

To prevent unnecessarily large Memoizer files in ImageIOReader
subclasses, the `img` field is marked transient. Access must
now be protected by a null check with a call to `initImage()`
if the field is null.

/cc @aleksandra-tarkowska, @kennethgillen

To test, open a JPEG file wrapped in a Memoizer with and without the patch. The file created first will be much larger than after. Be sure to delete the file between executions of setId:

```
public static void main(String[] args) throws Exception {
loci.formats.in.JPEGReader r = new loci.formats.in.JPEGReader();
loci.formats.Memoizer m = new loci.formats.Memoizer(r, 0, new java.io.File("/tmp/"));
m.setId("/tmp/test.jpg");
m.close();
}
```