From: Svjatoslav Agejenko Date: Sat, 13 Mar 2021 03:44:04 +0000 (+0200) Subject: generate thumbnails in webp format X-Git-Tag: meviz-1.4~8 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=9a96d6cd7fa903f3da1ff8e25d87316db3526678;p=meviz.git generate thumbnails in webp format --- 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;