X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FCbz.java;h=a5391d07575e9f6102ab531e4a756c1be718f711;hp=76b66aba7c75fa24317eb4daca6ff75854658326;hb=0a264fbe3d5a43516006052574a5f322d9d38897;hpb=d66deb8d8b30cff6b54db352eef34a3508939f84 diff --git a/src/be/nikiroo/fanfix/supported/Cbz.java b/src/be/nikiroo/fanfix/supported/Cbz.java index 76b66ab..a5391d0 100644 --- a/src/be/nikiroo/fanfix/supported/Cbz.java +++ b/src/be/nikiroo/fanfix/supported/Cbz.java @@ -63,6 +63,8 @@ class Cbz extends Epub { } else { pg.setMinMax(0, 100); } + + pg.setName("Initialising"); Progress pgMeta = new Progress(); pg.addProgress(pgMeta, 10); @@ -70,7 +72,7 @@ class Cbz extends Epub { MetaData meta = story.getMeta(); pgMeta.done(); // 10% - + File tmpDir = Instance.getInstance().getTempFiles().createTempDir("info-text"); String basename = null; @@ -95,7 +97,13 @@ class Cbz extends Epub { if (imageEntry) { String uuid = meta.getUuid() + "_" + entry.getName(); try { - images.put(uuid, new Image(zipIn)); + Image img = new Image(zipIn); + if (img.getSize() == 0) { + img.close(); + throw new IOException( + "Empty image not accepted"); + } + images.put(uuid, img); } catch (Exception e) { Instance.getInstance().getTraceHandler().error(e); } @@ -166,7 +174,7 @@ class Cbz extends Epub { } if (!imagesList.isEmpty()) { - Chapter chap = new Chapter(story.getChapters().size() + 1, null); + Chapter chap = new Chapter(story.getChapters().size() + 1, ""); story.getChapters().add(chap); for (String uuid : imagesList) { @@ -193,7 +201,7 @@ class Cbz extends Epub { } } - pg.setProgress(100); + pg.done(); return story; }