From: Niki Roo Date: Sat, 25 May 2019 20:42:30 +0000 (+0200) Subject: epub: allow save even if cover is broken X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=43c75fb78b7d47363c7a07fd7225b0b85275ff2e;p=fanfix-jexer.git epub: allow save even if cover is broken --- diff --git a/src/be/nikiroo/fanfix/output/Epub.java b/src/be/nikiroo/fanfix/output/Epub.java index e3280d1..b7401d3 100644 --- a/src/be/nikiroo/fanfix/output/Epub.java +++ b/src/be/nikiroo/fanfix/output/Epub.java @@ -136,8 +136,12 @@ class Epub extends BasicOutput { // OPS/images if (story.getMeta() != null && story.getMeta().getCover() != null) { File file = new File(images, "cover"); - Instance.getCache().saveAsImage(story.getMeta().getCover(), file, - true); + try { + Instance.getCache().saveAsImage(story.getMeta().getCover(), + file, true); + } catch (Exception e) { + Instance.getTraceHandler().error(e); + } } // OPS/* except chapters @@ -437,7 +441,8 @@ class Epub extends BasicOutput { if (story.getMeta() != null && story.getMeta().getCover() != null) { String format = Instance.getConfig() - .getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER).toLowerCase(); + .getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER) + .toLowerCase(); builder.append("\n "); }