Skip to content

Commit

Permalink
Fixed close() bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Sep 19, 2007
1 parent 321cc14 commit 22f15be
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions loci/formats/in/LegacyQTReader.java
Expand Up @@ -86,12 +86,6 @@ public BufferedImage openImage(int no) throws FormatException, IOException {
if (no < 0 || no >= getImageCount()) {
throw new FormatException("Invalid image number: " + no);
}

if (tools.isQTExpired()) {
throw new FormatException(LegacyQTTools.EXPIRED_QT_MSG);
}
if (!tools.canDoQT()) throw new FormatException(LegacyQTTools.NO_QT_MSG);

// paint frame into image
try {
r.setVar("time", times[no]);
Expand All @@ -102,18 +96,19 @@ public BufferedImage openImage(int no) throws FormatException, IOException {
catch (ReflectException re) {
throw new FormatException("Open movie failed", re);
}

return ImageTools.makeBuffered(image);
}

/* @see loci.formats.IFormatReader#close(boolean) */
public void close(boolean fileOnly) throws IOException {
try {
r.exec("openMovieFile.close()");
if (!fileOnly) {
r.exec("m.disposeQTObject()");
r.exec("imageTrack.disposeQTObject()");
r.exec("QTSession.close()");
if (r.getVar("openMovieFile") != null) {
r.exec("openMovieFile.close()");
if (!fileOnly) {
r.exec("m.disposeQTObject()");
r.exec("imageTrack.disposeQTObject()");
r.exec("QTSession.close()");
}
}
}
catch (ReflectException e) {
Expand Down

0 comments on commit 22f15be

Please sign in to comment.