feat: image processing improve

This commit is contained in:
2025-12-06 12:59:55 +03:00
parent 4e416ead49
commit 38668fb4a7
37 changed files with 411 additions and 366 deletions

View File

@@ -1,9 +1,7 @@
export function getThumb(imageUrl) {
if (!imageUrl) return '/image/no_image.png';
const extIndex = imageUrl.lastIndexOf('.');
const ext = imageUrl.substring(extIndex);
const filename = imageUrl.substring(0, extIndex);
return `/image/cache/${filename}-100x100${ext}`;
const route = 'extension/tgshop/handle';
const url = new URL(`${window.TeleCart.shop_base_url}/index.php?route=${route}&api_action=getImage&path=${imageUrl}&size=100x100`);
return url.toString();
}
export function rub(value) {