- public Story process(URL url) throws IOException {
- Story story = processMeta(url, false, true);
- story.setChapters(new ArrayList<Chapter>());
- Chapter chap = new Chapter(1, null);
- story.getChapters().add(chap);
-
- ZipInputStream zipIn = new ZipInputStream(getInput());
-
- for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn
- .getNextEntry()) {
- if (!entry.isDirectory()
- && entry.getName().startsWith(getDataPrefix())) {
- String entryLName = entry.getName().toLowerCase();
- boolean imageEntry = false;
- for (String ext : getImageExt(false)) {
- if (entryLName.endsWith(ext)) {
- imageEntry = true;
+ public Story doProcess(Progress pg) throws IOException {
+ if (pg == null) {
+ pg = new Progress();
+ } else {
+ pg.setMinMax(0, 100);
+ }
+
+ Progress pgMeta = new Progress();
+ pg.addProgress(pgMeta, 10);
+ Story story = processMeta(true, pgMeta);
+ MetaData meta = story.getMeta();
+
+ pgMeta.done(); // 10%
+
+ File tmpDir = Instance.getTempFiles().createTempDir("info-text");
+ String basename = null;
+
+ Map<String, Image> images = new HashMap<String, Image>();
+ InputStream cbzIn = null;
+ ZipInputStream zipIn = null;
+ try {
+ cbzIn = new MarkableFileInputStream(new FileInputStream(
+ getSourceFileOriginal()));
+ zipIn = new ZipInputStream(cbzIn);
+ for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn
+ .getNextEntry()) {
+ if (!entry.isDirectory()
+ && entry.getName().startsWith(getDataPrefix())) {
+ String entryLName = entry.getName().toLowerCase();
+ boolean imageEntry = false;
+ for (String ext : BasicSupportImages.getImageExt(false)) {
+ if (entryLName.endsWith(ext)) {
+ imageEntry = true;
+ }