Show error if image is greater than max prefetch size
This commit is contained in:
parent
6b024191c1
commit
335bd803af
@ -28,5 +28,11 @@
|
|||||||
<div class="body" title="{{body}}">{{body}}</div>
|
<div class="body" title="{{body}}">{{body}}</div>
|
||||||
</a>
|
</a>
|
||||||
{{/equal}}
|
{{/equal}}
|
||||||
|
{{#equal type "error"}}
|
||||||
|
<a class="toggle-text" href="{{link}}" target="_blank" rel="noopener">
|
||||||
|
<div class="head" title="{{head}}">{{head}}</div>
|
||||||
|
<div class="body" title="{{body}}">{{body}}</div>
|
||||||
|
</a>
|
||||||
|
{{/equal}}
|
||||||
</div>
|
</div>
|
||||||
{{/preview}}
|
{{/preview}}
|
||||||
|
@ -99,11 +99,13 @@ function parse(msg, preview, res, client) {
|
|||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
case "image/webp":
|
case "image/webp":
|
||||||
if (res.size > (Helper.config.prefetchMaxImageSize * 1024)) {
|
if (res.size > (Helper.config.prefetchMaxImageSize * 1024)) {
|
||||||
return;
|
preview.type = "error";
|
||||||
}
|
preview.head = "Large image";
|
||||||
|
preview.body = "Image is greater than your max image size. Click to view.";
|
||||||
|
} else {
|
||||||
preview.type = "image";
|
preview.type = "image";
|
||||||
preview.thumb = preview.link;
|
preview.thumb = preview.link;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user