feat: compress uploads and serve resized image variants via /api/img

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
mahmood
2026-11-14 15:07:11 +03:30
co-authored by Cursor
parent b71fb678be
commit 3fe0a930c7
32 changed files with 976 additions and 52 deletions
+3 -2
View File
@@ -21,7 +21,7 @@
width="90px"
height="90px"
style="object-fit: scale-down"
:src="record.thumb && record.thumb.full ? record.thumb.full : noImage"
:src="record.thumb && record.thumb.full ? imageUrl(record.thumb.full, 200) : noImage"
/>
</template>
@@ -205,6 +205,7 @@
<script setup lang="ts">
import { optionText } from '../../utils/select';
import { imageUrl } from '../../utils/image';
import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import { message } from 'ant-design-vue';
@@ -294,7 +295,7 @@ function getVariant(item: CartItem): CartVariant & Record<string, any> {
}
function getImage(product: Record<string, any>) {
return product?.thumb?.full ?? product?.ProductImage?.[0]?.image ?? noImage;
return imageUrl(product?.thumb?.full ?? product?.ProductImage?.[0]?.image, 200) ?? noImage;
}
/** legacy totalWeight — note it does NOT multiply by qty. Preserved. */