Use jpeg as thumbnail extension except for gif-s.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 5 Jan 2020 17:15:59 +0000 (19:15 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 5 Jan 2020 17:15:59 +0000 (19:15 +0200)
src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/fileTypes/Picture.java

index 3761024..6f74473 100755 (executable)
@@ -236,8 +236,10 @@ 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";
+
         return FilePathParser.getFileNameWithoutExtension(fileName) + " ("
-                + computeThumbnailHash(targetDimension) + ")." + getFileExtension();
+                + computeThumbnailHash(targetDimension) + ")." + thumbnailExtension;
     }
 
     @Override