<artifactId>core-image</artifactId>
<version>1.3.10</version>
</dependency>
+ <dependency>
+ <groupId>org.sejda.imageio</groupId>
+ <artifactId>webp-imageio</artifactId>
+ <version>0.1.6</version>
+ </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.scijava</groupId>-->
+<!-- <artifactId>native-lib-loader</artifactId>-->
+<!-- <version>2.3.5</version>-->
+<!-- </dependency>-->
</dependencies>
<distributionManagement>
"E-mail: svjatoslav@svjatoslav.eu, homepage: http://svjatoslav.eu";
public static final String[] SUPPORTED_IMAGE_EXTENSIONS = {
- "jpg", "jpeg", "png", "gif"};
+ "jpg", "jpeg", "png", "gif", "webp"};
public static final String[] SUPPORTED_VIDEO_EXTENSIONS = {
"avi", "mp4", "mpeg", "mpg", "mkv", "flv", "ogv"};
package eu.svjatoslav.meviz.htmlindexer.indexer;
-import eu.svjatoslav.commons.file.IOHelper;
-import eu.svjatoslav.meviz.htmlindexer.*;
+import eu.svjatoslav.meviz.htmlindexer.CommandlineHandler;
+import eu.svjatoslav.meviz.htmlindexer.Constants;
+import eu.svjatoslav.meviz.htmlindexer.IndexingContext;
+import eu.svjatoslav.meviz.htmlindexer.Utils;
import eu.svjatoslav.meviz.htmlindexer.layouts.Layout;
import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension;
import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata;
import java.util.HashSet;
import java.util.List;
+import static eu.svjatoslav.commons.file.IOHelper.overwriteFileIfContentDiffers;
import static eu.svjatoslav.meviz.htmlindexer.Constants.THUMBNAILS_DIRECTORY_NAME;
import static eu.svjatoslav.meviz.htmlindexer.Utils.getThumbnailsDirectoryPath;
import static eu.svjatoslav.meviz.htmlindexer.Utils.urlEncode;
compileHtml(layout, metadata);
- IOHelper.overwriteFileIfContentDiffers(indexFile, layout
+ overwriteFileIfContentDiffers(indexFile, layout
.getHtml(true, true, metadata).getBytes());
}
} catch (final Exception e) {
try {
return new Picture(parentDirectory, fileName);
} catch (final Exception exception) {
+ System.out.println("Failed to decode image \"" + fileName +"\" indexing as normal file instead.");
+
// in case image decoding failed, handle image as general file
return new GeneralFile(parentDirectory, fileName);
}
System.out.println("Desired target image dimensions:" + targetDimensions);
- FileInputStream fiStream = new FileInputStream(inputFile);
-
ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next();
ImageInputStream stream = ImageIO.createImageInputStream(inputFile);
reader.setInput(stream);
Utils.ImageFrame[] frames = Utils.readGIF(reader);
for (Utils.ImageFrame frame : frames) {
Image scaleImage = scaleImage(frame.image, targetDimensions.width, targetDimensions.height);
- BufferedImage bimage = new BufferedImage(
+ BufferedImage bImage = new BufferedImage(
targetDimensions.width, targetDimensions.height, BufferedImage.TYPE_INT_ARGB);
- Graphics2D bGr = bimage.createGraphics();
+ Graphics2D bGr = bImage.createGraphics();
bGr.drawImage(scaleImage, 0, 0, null);
bGr.dispose();
- frame.image = bimage;
+ frame.image = bImage;
}
ImageOutputStream output = new FileImageOutputStream(outputFile);