diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 572e2e0..90a8f21 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -62,14 +62,6 @@ jobs: username: ziedelth password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Build and push snapshot - uses: docker/build-push-action@v5 - if: github.ref == 'refs/heads/master' - with: - context: . - push: true - tags: registry.ziedelth.fr:5000/jais-api:snapshot - - name: Build and push production uses: docker/build-push-action@v5 if: github.ref == 'refs/heads/stable' diff --git a/src/main/kotlin/fr/ziedelth/utils/ImageCache.kt b/src/main/kotlin/fr/ziedelth/utils/ImageCache.kt index 296f5f7..7b64218 100644 --- a/src/main/kotlin/fr/ziedelth/utils/ImageCache.kt +++ b/src/main/kotlin/fr/ziedelth/utils/ImageCache.kt @@ -29,6 +29,8 @@ object ImageCache { try { bytes = saveImage(url).readBytes() + if (bytes.isEmpty()) throw Exception("Failed to load image") + val webp = encodeToWebP(bytes) cache[uuid] = Image(url, webp, "webp") to true } catch (e: Exception) { @@ -50,7 +52,7 @@ object ImageCache { if (Imgcodecs.imencode(".webp", matImage, output, parameters)) { return output.toArray() } else { - error("Failed to encode the image as webp") + throw Exception("Failed to encode image to WebP") } }