Remove or move java.awt dependencies
[nikiroo-utils.git] / src / be / nikiroo / fanfix / output / Text.java
index ee72385b32220c479e1e03ad2d8a378f59539e49..b45a51284bf913501bb0fa7fefd4c12a371c8bc8 100644 (file)
@@ -17,6 +17,7 @@ import be.nikiroo.fanfix.data.Story;
 class Text extends BasicOutput {
        protected BufferedWriter writer;
        protected File targetDir;
+       private boolean nextParaIsCover = true;
 
        @Override
        public File process(Story story, File targetDir, String targetName)
@@ -104,8 +105,11 @@ class Text extends BasicOutput {
        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);
+                       Instance.getCache().saveAsImage(para.getContentImage(), file,
+                                       nextParaIsCover);
                }
+
+               nextParaIsCover = false;
        }
 
        @Override