fix: 桌面端查看表情图片缩略图显示错误

This commit is contained in:
kuaifan 2024-12-16 21:23:18 +08:00
parent 23188777fe
commit 008653e3d9

View File

@ -37,13 +37,16 @@
const {ipcRenderer} = require('electron');
const thumbnailUrl = (url) => {
url = `${url}`
.replace(/_thumb\.(png|jpg|jpeg)$/, '')
.replace(/\/crop\/([^\/]+)$/, '')
if (!/^https?:\/\/[^\/]+\/uploads\//.test(url)) {
return url
}
const crops = {
ratio: 3,
percentage: '320x0'
}
url = `${url}`
.replace(/_thumb\.(png|jpg|jpeg)$/, '')
.replace(/\/crop\/([^\/]+)$/, '')
return url + "/crop/" + Object.keys(crops).map(key => {
return `${key}:${crops[key]}`
}).join(",")