From 43c75fb78b7d47363c7a07fd7225b0b85275ff2e Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 25 May 2019 22:42:30 +0200 Subject: [PATCH] epub: allow save even if cover is broken --- src/be/nikiroo/fanfix/output/Epub.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/be/nikiroo/fanfix/output/Epub.java b/src/be/nikiroo/fanfix/output/Epub.java index e3280d12..b7401d39 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 "); } -- 2.27.0