Small fixes: update check, epub:
[fanfix.git] / src / be / nikiroo / fanfix / supported / Epub.java
index 6cfe4f3d38de3b26b6b4392e1d55fedfb82a32c2..bd5c7191a86fe687942a6411c4291ff9010ad060 100644 (file)
@@ -15,6 +15,7 @@ import java.util.zip.ZipInputStream;
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.MarkableFileInputStream;
 import be.nikiroo.utils.Progress;
 
@@ -96,7 +97,7 @@ class Epub extends InfoText {
                        if (!entry.isDirectory()
                                        && entry.getName().startsWith(getDataPrefix())) {
                                String entryLName = entry.getName().toLowerCase();
-
+                               
                                boolean imageEntry = false;
                                for (String ext : getImageExt(false)) {
                                        if (entryLName.endsWith(ext)) {
@@ -114,7 +115,7 @@ class Epub extends InfoText {
                                        // Cover
                                        if (getCover()) {
                                                try {
-                                                       cover = IOUtils.toImage(zipIn);
+                                                       cover = ImageUtils.fromStream(zipIn);
                                                } catch (Exception e) {
                                                        Instance.syserr(e);
                                                }
@@ -165,7 +166,10 @@ class Epub extends InfoText {
 
                tmp = null;
 
-               fakeIn.close();
+               if (fakeIn != null) {
+                       fakeIn.close();
+               }
+
                super.close();
        }