package be.nikiroo.fanfix.supported;
-import java.awt.image.BufferedImage;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.ImageUtils;
+import be.nikiroo.utils.Image;
import be.nikiroo.utils.Progress;
/**
}
@Override
- protected boolean getCover() {
- return false;
+ protected boolean isImagesDocumentByDefault() {
+ return true;
}
@Override
- protected void preprocess(URL source, InputStream in) throws IOException {
- super.preprocess(source, in);
- meta.setImageDocument(true);
+ protected boolean getCover() {
+ return false;
}
@Override
ZipInputStream zipIn = new ZipInputStream(getInput());
- Map<String, BufferedImage> images = new HashMap<String, BufferedImage>();
+ Map<String, Image> images = new HashMap<String, Image>();
for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn
.getNextEntry()) {
if (!entry.isDirectory()
if (imageEntry) {
String uuid = meta.getUuid() + "_" + entry.getName();
try {
- images.put(uuid, ImageUtils.fromStream(zipIn));
+ images.put(uuid, new Image(zipIn));
} catch (Exception e) {
Instance.getTraceHandler().error(e);
}
if (meta.getCover() == null && !images.isEmpty()) {
meta.setCover(images.get(imagesList.get(0)));
+ meta.setFakeCover(true);
}
pg.setProgress(100);