|
@@ -78,6 +78,10 @@ export default class BookParser {
|
|
resolve();
|
|
resolve();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ i.onerror = (e) => {
|
|
|
|
+ reject(e);
|
|
|
|
+ };
|
|
|
|
+
|
|
i.src = `data:${binaryType};base64,${data}`;
|
|
i.src = `data:${binaryType};base64,${data}`;
|
|
await sleep(30*1000);
|
|
await sleep(30*1000);
|
|
if (!resolved)
|
|
if (!resolved)
|
|
@@ -98,6 +102,10 @@ export default class BookParser {
|
|
resolve();
|
|
resolve();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ i.onerror = (e) => {
|
|
|
|
+ reject(e);
|
|
|
|
+ };
|
|
|
|
+
|
|
i.src = src;
|
|
i.src = src;
|
|
await sleep(30*1000);
|
|
await sleep(30*1000);
|
|
if (!resolved)
|
|
if (!resolved)
|
|
@@ -641,9 +649,9 @@ export default class BookParser {
|
|
//изображения
|
|
//изображения
|
|
if (part.image.id && !part.image.inline) {
|
|
if (part.image.id && !part.image.inline) {
|
|
parsed.visible = this.showImages;
|
|
parsed.visible = this.showImages;
|
|
- const bin = this.binary[part.image.id];
|
|
|
|
|
|
+ let bin = this.binary[part.image.id];
|
|
if (!bin)
|
|
if (!bin)
|
|
- continue;
|
|
|
|
|
|
+ bin = {h: 0, w: 0};
|
|
|
|
|
|
let lineCount = this.imageHeightLines;
|
|
let lineCount = this.imageHeightLines;
|
|
const c = Math.ceil(bin.h/this.lineHeight);
|
|
const c = Math.ceil(bin.h/this.lineHeight);
|
|
@@ -670,6 +678,7 @@ export default class BookParser {
|
|
line.last = true;
|
|
line.last = true;
|
|
line.parts.push({style, text: ' ',
|
|
line.parts.push({style, text: ' ',
|
|
image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, paraIndex}});
|
|
image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, paraIndex}});
|
|
|
|
+
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|