#13 use webp instead of jpeg/png
This commit is contained in:
parent
5707d1bb1f
commit
2885ece241
|
|
@ -4,9 +4,9 @@
|
|||
"secure": false,
|
||||
"changeOrigin": true
|
||||
},
|
||||
"/debug_images": {
|
||||
"/images": {
|
||||
"target": "http://localhost:8080",
|
||||
"secure": false,
|
||||
"changeOrigin": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<div class="flex items-center space-x-2">
|
||||
<div class="relative group">
|
||||
<div class="absolute left-0 bottom-full mb-2 w-48 bg-white border border-gray-300 rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10 pointer-events-none">
|
||||
<img src="/debug_images/{{ image.bildid }}/thumbnail.jpg" alt="{{ image.name }}" class="w-full h-auto object-cover" />
|
||||
<img src="/images/{{ image.bildid }}/thumbnail.webp" alt="{{ image.name }}" class="w-full h-auto object-cover" />
|
||||
</div>
|
||||
<span class="font-medium cursor-pointer">{{ image.name }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ export class DeckListComponent implements OnInit {
|
|||
// Method to edit an image in a deck
|
||||
editImage(deck: Deck, image: DeckImage): void {
|
||||
let imageSrc = null;
|
||||
fetch(`/debug_images/${image.bildid}/original_compressed.jpg`)
|
||||
fetch(`/images/${image.bildid}/original.webp`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ export class TrainingComponent implements OnInit {
|
|||
if (!ctx || !this.currentImageData) return;
|
||||
|
||||
const img = new Image();
|
||||
img.src = `/debug_images/${this.currentImageData.bildid}/original_compressed.jpg`;
|
||||
img.src = `/images/${this.currentImageData.bildid}/original.webp`;
|
||||
img.onload = () => {
|
||||
// Set the canvas size to the image size
|
||||
canvas.width = img.width;
|
||||
|
|
|
|||
Loading…
Reference in New Issue