0

I have a custom script which converts jpg to txt using tessaract 3.01. When i execute the script from command line the conversion works fine but when the same script is executed from a java application running on tomcat, it seems the application cannot find tesseract. This issue is happening on my redhat 6.2 box but not on my ubuntu 12.04 box.

The script:

#!/bin/sh 
SOURCE=$1 
TARGET=/tmp/ocrOutput 
echo "Starting tesseract" 
tesseract $SOURCE $TARGET -l eng 
echo " Finished"

Can someone please advice?

shadow
  • 21,823
  • 4
  • 63
  • 77
Kavi
  • 41
  • 1
  • show the problematic code. – MeBigFatGuy Dec 01 '14 at 00:44
  • There could be many differences between RH and Ubuntu, including SELinux settings. Check the web server logs under /var/log and possibly the security logs there as well. Something there should steer you in the right direction. – rand'Chris Dec 01 '14 at 01:22
  • @MeBigFatGuy #!/bin/sh SOURCE=$1 TARGET=/tmp/ocrOutput echo "Starting tesseract" tesseract $SOURCE $TARGET -l eng echo " Finished" – Kavi Dec 01 '14 at 04:14
  • @rand'Chris SElinux is disabled and nothing in the webserver log as well – Kavi Dec 01 '14 at 04:18

1 Answers1

0

The informations given are very minimal, but I guess it is a path problem. Try to use the full path when calling tesseract.

tobltobs
  • 2,782
  • 1
  • 27
  • 33