generate thumbnails in webp format
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 13 Mar 2021 03:44:04 +0000 (05:44 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 13 Mar 2021 03:44:04 +0000 (05:44 +0200)
src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java

index 50b39d5..1f5b272 100755 (executable)
@@ -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;