Skip to content

Commit

Permalink
TIKA-2635 -- require that user specify path for imagemagick on window…
Browse files Browse the repository at this point in the history
…s to avoid conflict with system util "convert.exe"
  • Loading branch information
tballison committed Apr 19, 2018
1 parent c68994f commit e84d0d5
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.tika.config.Initializable;
import org.apache.tika.config.InitializableProblemHandler;
import org.apache.tika.config.Param;
Expand Down Expand Up @@ -184,6 +185,12 @@ private boolean hasImageMagick(TesseractOCRConfig config) {
IMAGE_MAGICK_PRESENT.put(ImageMagick, false);
return false;
}
if (SystemUtils.IS_OS_WINDOWS && config.getImageMagickPath().isEmpty()) {
LOG.warn("Must specify path for imagemagick on Windows OS to avoid accidental confusion with convert.exe");
IMAGE_MAGICK_PRESENT.put(ImageMagick, false);
return false;
}

// Try running ImageMagick program from there, and see if it exists + works
String[] checkCmd = { ImageMagick };
boolean hasImageMagick = ExternalParser.check(checkCmd);
Expand Down

0 comments on commit e84d0d5

Please sign in to comment.