2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012 -- 2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.encoder.converters;
12 import eu.svjatoslav.meviz.encoder.EncodingOptions;
15 import java.util.List;
17 public class Ocr extends AbstractConverter {
20 public String getCommand(final File inputFile, final File targetFile,
21 final EncodingOptions options, String targetFormat) {
23 // for some stupid reason tesseract ALWAYS insists on automatically
25 String targetAbsolutePath = targetFile.getAbsolutePath();
26 String targetFileName = targetAbsolutePath.substring(0,
27 targetAbsolutePath.length() - 4);
29 return "tesseract \"" + inputFile.getAbsolutePath() + "\" \""
30 + targetFileName + "\"";
34 public List<String> getSourceFileExtensions() {
35 return toList("tif", "tiff", "png", "jpg", "jpeg");
39 public List<String> getTargetFileExtensions() {
44 public boolean isTerminalMandatory() {