From 2885ece24184e1645a09621b2fe93d0fe541ae46 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 30 Jan 2025 20:38:22 +0100 Subject: [PATCH] #13 use webp instead of jpeg/png --- proxy.conf.json | 22 +++++++++++----------- src/app/deck-list.component.html | 2 +- src/app/deck-list.component.ts | 2 +- src/app/training/training.component.ts | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/proxy.conf.json b/proxy.conf.json index a811e84..ee6e920 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -1,12 +1,12 @@ { - "/api": { - "target": "http://localhost:3000", - "secure": false, - "changeOrigin": true - }, - "/debug_images": { - "target": "http://localhost:8080", - "secure": false, - "changeOrigin": true - } - } \ No newline at end of file + "/api": { + "target": "http://localhost:3000", + "secure": false, + "changeOrigin": true + }, + "/images": { + "target": "http://localhost:8080", + "secure": false, + "changeOrigin": true + } +} \ No newline at end of file diff --git a/src/app/deck-list.component.html b/src/app/deck-list.component.html index 0dd1d90..914a773 100644 --- a/src/app/deck-list.component.html +++ b/src/app/deck-list.component.html @@ -67,7 +67,7 @@
- {{ image.name }} + {{ image.name }}
{{ image.name }}
diff --git a/src/app/deck-list.component.ts b/src/app/deck-list.component.ts index e7de2e3..9c743e9 100644 --- a/src/app/deck-list.component.ts +++ b/src/app/deck-list.component.ts @@ -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'); diff --git a/src/app/training/training.component.ts b/src/app/training/training.component.ts index 86cf16c..44ded54 100644 --- a/src/app/training/training.component.ts +++ b/src/app/training/training.component.ts @@ -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;