class Text extends BasicOutput {
protected BufferedWriter writer;
protected File targetDir;
+ private boolean nextParaIsCover = true;
@Override
public File process(Story story, File targetDir, String targetName)
protected void writeParagraphHeader(Paragraph para) throws IOException {
if (para.getType() == ParagraphType.IMAGE) {
File file = new File(targetDir, getCurrentImageBestName(true));
- Instance.getCache().saveAsImage(para.getContentImage(), file);
+ try {
+ Instance.getCache().saveAsImage(para.getContentImage(), file,
+ nextParaIsCover);
+ } catch (IOException e) {
+ Instance.getTraceHandler().error(
+ new IOException("Cannot save an image", e));
+ }
}
+
+ nextParaIsCover = false;
}
@Override