8d685624ad8ecee468bf1be069a2df00a16f57ce
[meviz.git] / src / main / java / eu / svjatoslav / meviz / encoder / converters / WebpDecoder.java
1 /*
2  * Meviz - Various tools collection to work with multimedia. Author: Svjatoslav Agejenko.
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5
6 package eu.svjatoslav.meviz.encoder.converters;
7
8 import eu.svjatoslav.meviz.encoder.EncodingOptions;
9
10 import java.io.File;
11 import java.util.List;
12
13 /**
14  * webp decoder.
15  */
16
17 public class WebpDecoder extends AbstractConverter {
18
19     @Override
20     public String getCommand(final File inputFile, final File targetFile,
21                              final EncodingOptions options, String targetFormat) {
22
23         return "dwebp \"" + inputFile.getAbsolutePath() + "\" -o \"" +
24                 targetFile.getAbsolutePath() + "\"";
25     }
26
27     @Override
28     public List<String> getTargetFileExtensions() {
29         return toList("png");
30     }
31
32     @Override
33     public List<String> getSourceFileExtensions() {
34         return toList("webp");
35     }
36
37     @Override
38     public boolean isTerminalMandatory() {
39         return false;
40     }
41
42 }