diff --git a/public/assets/placeholder.svg b/public/assets/placeholder.svg new file mode 100644 index 0000000..a8c9d51 --- /dev/null +++ b/public/assets/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/scripts/books/reader.js b/src/scripts/books/reader.js index 2daa005..31f78e1 100644 --- a/src/scripts/books/reader.js +++ b/src/scripts/books/reader.js @@ -294,6 +294,13 @@ function createImageElement(page, index) { img.dataset.index = index; const url = buildProxyUrl(page.url, page.headers); + const placeholder = "/public/assets/placeholder.svg"; + + img.onerror = () => { + if (img.src !== placeholder) { + img.src = placeholder; + } + }; if (config.manga.mode === 'longstrip' && index > 0) { img.classList.add('longstrip-fit');