/*
* Meviz - Various tools collection to work with multimedia.
- * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright (C) 2012 -- 2017-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public License
- * as published by the Free Software Foundation.
- */
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+*/
package eu.svjatoslav.meviz.encoder.converters;
+import eu.svjatoslav.meviz.encoder.EncodingOptions;
+
import java.io.File;
import java.util.List;
-import eu.svjatoslav.meviz.encoder.EncodingOptions;
-
public class Convert extends AbstractConverter {
- @Override
- public String getCommand(final File inputFile, final File targetFile,
- final EncodingOptions options, String targetFormat) {
- return "convert \"" + inputFile.getAbsolutePath() + "\" \""
- + targetFile.getAbsolutePath() + "\"";
- }
-
- @Override
- public List<String> getSourceFileExtensions() {
- return toList("tif", "tiff", "png", "jpg", "jpeg");
- }
-
- @Override
- public List<String> getTargetFileExtensions() {
- return toList("png", "tiff", "tif");
- }
-
- @Override
- public boolean isTerminalMandatory() {
- return false;
- }
+ @Override
+ public String getCommand(final File inputFile, final File targetFile,
+ final EncodingOptions options, String targetFormat) {
+ return "convert \"" + inputFile.getAbsolutePath() + "\" \""
+ + targetFile.getAbsolutePath() + "\"";
+ }
+
+ @Override
+ public List<String> getSourceFileExtensions() {
+ return getSupportedFormats();
+ }
+
+ private List<String> getSupportedFormats() {
+ return toList("tif", "tiff", "png", "jpg", "jpeg", "bmp", "gif");
+ }
+
+ @Override
+ public List<String> getTargetFileExtensions() {
+ return getSupportedFormats();
+ }
+
+ @Override
+ public boolean isTerminalMandatory() {
+ return false;
+ }
}