git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update from master
[nikiroo-utils.git]
/
supported
/
BasicSupport_Deprecated.java
diff --git
a/supported/BasicSupport_Deprecated.java
b/supported/BasicSupport_Deprecated.java
index ad030c0ced64825def174a7bfed5d81b4f00c7d9..40ff3fc027c7e52beca3426017e1a6a58972fbbe 100644
(file)
--- a/
supported/BasicSupport_Deprecated.java
+++ b/
supported/BasicSupport_Deprecated.java
@@
-317,7
+317,6
@@
public abstract class BasicSupport_Deprecated extends BasicSupport {
words += cc.getWords();
story.getChapters().add(cc);
words += cc.getWords();
story.getChapters().add(cc);
- story.getMeta().setWords(words);
} finally {
if (chapIn != null) {
chapIn.close();
} finally {
if (chapIn != null) {
chapIn.close();
@@
-326,6
+325,8
@@
public abstract class BasicSupport_Deprecated extends BasicSupport {
i++;
}
i++;
}
+
+ story.getMeta().setWords(words);
pgChaps.setName("Extracting chapters");
} else {
pgChaps.setName("Extracting chapters");
} else {
@@
-340,6
+341,7
@@
public abstract class BasicSupport_Deprecated extends BasicSupport {
resume.setName("");
resume.setNumber(1);
story.getChapters().add(resume);
resume.setName("");
resume.setNumber(1);
story.getChapters().add(resume);
+ story.getMeta().setWords(resume.getWords());
String descChapterName = Instance.getInstance().getTrans()
.getString(StringId.DESCRIPTION);
String descChapterName = Instance.getInstance().getTrans()
.getString(StringId.DESCRIPTION);
@@
-649,7
+651,13
@@
public abstract class BasicSupport_Deprecated extends BasicSupport {
InputStream in = null;
try {
in = Instance.getInstance().getCache().open(url, getSupport(url), true);
InputStream in = null;
try {
in = Instance.getInstance().getCache().open(url, getSupport(url), true);
- return new Image(in);
+ Image img = new Image(in);
+ if (img.getSize() == 0) {
+ img.close();
+ throw new IOException(
+ "Empty image not accepted");
+ }
+ return img;
} catch (IOException e) {
} finally {
if (in != null) {
} catch (IOException e) {
} finally {
if (in != null) {