X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=supported%2FCbz.java;h=a5391d07575e9f6102ab531e4a756c1be718f711;hb=002972e9de731678035d56304d75a6d9e8233635;hp=a6188ec55085467b1306f5a9ac91e0083bdf014d;hpb=d910e8117de39dc7eaf4d7bda95c43b3123268fe;p=nikiroo-utils.git diff --git a/supported/Cbz.java b/supported/Cbz.java index a6188ec..a5391d0 100644 --- a/supported/Cbz.java +++ b/supported/Cbz.java @@ -97,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); } @@ -168,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) {