fix: closes #13036, if image isn't loaded yet width is 0

This commit is contained in:
Barış Soner Uşaklı
2025-01-08 09:43:08 -05:00
parent 82538ca333
commit d05c203bb2
2 changed files with 1 additions and 3 deletions

View File

@@ -122,8 +122,6 @@ get:
type: array type: array
items: items:
type: string type: string
resizeImageWidth:
type: number
cookies: cookies:
type: object type: object
properties: properties:

View File

@@ -19,7 +19,7 @@ define('forum/topic/images', [], function () {
} }
if (!imageEl.parent().is('a')) { if (!imageEl.parent().is('a')) {
if (utils.isRelativeUrl(src) && suffixRegex.test(src) && imageEl.get(0).naturalWidth >= config.resizeImageWidth) { if (utils.isRelativeUrl(src) && suffixRegex.test(src)) {
src = src.replace(suffixRegex, '$1'); src = src.replace(suffixRegex, '$1');
} }
const alt = imageEl.attr('alt') || ''; const alt = imageEl.attr('alt') || '';