diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue index e9df7c0c180..b95070fb5f1 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue @@ -149,8 +149,8 @@ export default { * File size in bytes */ size: { - type: Number, - default: -1, + type: String, + default: '-1', }, /** * Download link @@ -177,8 +177,8 @@ export default { * File ETag */ permissions: { - type: Number, - default: 0, + type: String, + default: '0', }, /** * Whether a preview is available, string "yes" for yes @@ -194,7 +194,7 @@ export default { * If preview and metadata are available, return width */ width: { - type: Number, + type: String, default: null, }, @@ -202,7 +202,7 @@ export default { * If preview and metadata are available, return height */ height: { - type: Number, + type: String, default: null, }, @@ -402,12 +402,12 @@ export default { } const sizeMultiplicator = Math.min( - (heightConstraint > this.height ? 1 : (heightConstraint / this.height)), - (widthConstraint > this.width ? 1 : (widthConstraint / this.width)) + (heightConstraint > parseInt(this.height, 10) ? 1 : (heightConstraint / parseInt(this.height, 10))), + (widthConstraint > parseInt(this.width, 10) ? 1 : (widthConstraint / parseInt(this.width, 10))) ) return { - width: this.width * sizeMultiplicator + 'px', + width: parseInt(this.width, 10) * sizeMultiplicator + 'px', aspectRatio: this.width + '/' + this.height, } }, @@ -421,7 +421,7 @@ export default { return PREVIEW_TYPE.MIME_ICON } const maxGifSize = getCapabilities()?.spreed?.config?.previews?.['max-gif-size'] || 3145728 - if (this.mimetype === 'image/gif' && this.size <= maxGifSize) { + if (this.mimetype === 'image/gif' && parseInt(this.size, 10) <= maxGifSize) { return PREVIEW_TYPE.DIRECT }