From 9a96d6cd7fa903f3da1ff8e25d87316db3526678 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 13 Mar 2021 05:44:04 +0200 Subject: [PATCH] generate thumbnails in webp format --- .../meviz/htmlindexer/metadata/fileTypes/Picture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java index 50b39d5..1f5b272 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java @@ -148,7 +148,7 @@ public class Picture extends AbstractFile { g.drawImage(scaledImage, 0, 0, null); g.dispose(); - ImageIO.write(bufferedImage, "jpg", out); + ImageIO.write(bufferedImage, "webp", out); out.close(); } @@ -234,7 +234,7 @@ public class Picture extends AbstractFile { * relative to designated thumbnails directory within parent directory. */ public String getRelativeThumbnailFileName(final Dimension targetDimension) { - String thumbnailExtension = "gif".equalsIgnoreCase(getFileExtension()) ? "gif" : "jpeg"; + String thumbnailExtension = "gif".equalsIgnoreCase(getFileExtension()) ? "gif" : "webp"; return FilePathParser.getFileNameWithoutExtension(fileName) + " (" + computeThumbnailHash(targetDimension) + ")." + thumbnailExtension; -- 2.20.1