feat: image processing improve
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user