title: Not entering inside tessract method doOCR(File imageFile)
body: <p>I have created a small console application to do OCR on a .tiff image file, I have done this using tess4j.</p>
  
  <pre><code>public class JavaApplication10 {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) 
  {
      File imageFile = new File("C:\\Users\\Manesh\\Desktop\\license_plate.tiff");
  
      Tesseract instance = Tesseract.getInstance();  // JNA Interface Mapping
  
      // Tesseract1 instance = new Tesseract1(); // JNA Direct Mapping
      try 
      {
          String result = instance.doOCR(imageFile); //Empty result
          System.out.println("hahahaha");
          System.out.println("The result is: " + result);
      }
      catch (TesseractException e) 
      {
          System.out.println("error:" + e);
      }
    }
  }
  </code></pre>
  
  <p>I'm not getting any value inside result, when I looked into the code of Tesseract class and inserted a couple of System.out.println those are also not getting printed in the console. My Tesseract code is given below.</p>
  
  <pre><code>public class Tesseract 
  {
  
  private static Tesseract instance;
  private final static Rectangle EMPTY_RECTANGLE = new Rectangle();
  private String language = "eng";
  private String datapath = "tessdata";
  private int psm = TessAPI.TessPageSegMode.PSM_AUTO;
  private boolean hocr;
  private int pageNum;
  private int ocrEngineMode = TessAPI.TessOcrEngineMode.OEM_DEFAULT;
  private Properties prop = new Properties();
  public final static String htmlBeginTag =
          "&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""
          + " \"http://www.w3.org/TR/html4/loose.dtd\"&gt;\n"
          + "&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;&lt;/title&gt;\n"
          + "&lt;meta http-equiv=\"Content-Type\" content=\"text/html;"
          + "charset=utf-8\" /&gt;\n&lt;meta name='ocr-system' content='tesseract'/&gt;\n"
          + "&lt;/head&gt;\n&lt;body&gt;\n";
  public final static String htmlEndTag = "&lt;/body&gt;\n&lt;/html&gt;\n";
  private Tesseract() 
  {
      System.setProperty("jna.encoding", "UTF8");
  }
  public static synchronized Tesseract getInstance() 
  {
      if (instance == null) 
      {
          instance = new Tesseract();
      }
  
      return instance;
  }
  public void setDatapath(String datapath) 
  {
      this.datapath = datapath;
  }
  public void setLanguage(String language) 
  {
      this.language = language;
  }
  public void setOcrEngineMode(int ocrEngineMode) 
  {
      this.ocrEngineMode = ocrEngineMode;
  }
  
  public void setPageSegMode(int mode) 
  {
      this.psm = mode;
  }
  
  public void setHocr(boolean hocr) 
  {
      this.hocr = hocr;
      prop.setProperty("tessedit_create_hocr", hocr ? "1" : "0");
  }
  
  public void setTessVariable(String key, String value) 
  {
      prop.setProperty(key, value);
  }
  
  public String doOCR(File imageFile) throws TesseractException 
  {
      System.out.println("hiiiiiii "); //not getting printed
      return doOCR(imageFile, null);
  }
  
  
  public String doOCR(File imageFile, Rectangle rect) throws TesseractException 
  {
      try 
      {
       System.out.println("be: "); //not getting printed
       return doOCR(ImageIOHelper.getIIOImageList(imageFile), rect);
      } 
      catch (IOException ioe) 
      {
          throw new TesseractException(ioe);
      }
  }
  
  public String doOCR(BufferedImage bi) throws TesseractException 
  {
      return doOCR(bi, null);
  }
  
  
  public String doOCR(BufferedImage bi, Rectangle rect) throws TesseractException 
  {
      IIOImage oimage = new IIOImage(bi, null, null);
      List&lt;IIOImage&gt; imageList = new ArrayList&lt;IIOImage&gt;();
      imageList.add(oimage);
      return doOCR(imageList, rect);
  }
  
  public String doOCR(List&lt;IIOImage&gt; imageList, Rectangle rect) throws TesseractException 
  {
      StringBuilder sb = new StringBuilder();
      pageNum = 0;
  
      for (IIOImage oimage : imageList) 
      {
          pageNum++;
          try 
          {
              ByteBuffer buf = ImageIOHelper.getImageByteBuffer(oimage);
              RenderedImage ri = oimage.getRenderedImage();
              String pageText = doOCR(ri.getWidth(), ri.getHeight(), buf, rect,     ri.getColorModel().getPixelSize());
              sb.append(pageText);
          } 
          catch (IOException ioe) 
          {
              //skip the problematic image
              System.err.println(ioe.getMessage());
          }
      }
  
      if (hocr) 
      {
          sb.insert(0, htmlBeginTag).append(htmlEndTag);
      }
      return sb.toString();
  }
  
  
  public String doOCR(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) throws TesseractException 
  {
      TessAPI api = TessAPI.INSTANCE;
      TessAPI.TessBaseAPI handle = api.TessBaseAPICreate();
      api.TessBaseAPIInit2(handle, datapath, language, ocrEngineMode);
      api.TessBaseAPISetPageSegMode(handle, psm);
  
      Enumeration em = prop.propertyNames();
      while (em.hasMoreElements()) 
      {
          String key = (String) em.nextElement();
          api.TessBaseAPISetVariable(handle, key, prop.getProperty(key));
      }
  
      int bytespp = bpp / 8;
      int bytespl = (int) Math.ceil(xsize * bpp / 8.0);
      api.TessBaseAPISetImage(handle, buf, xsize, ysize, bytespp, bytespl);
  
      if (rect != null &amp;&amp; !rect.equals(EMPTY_RECTANGLE)) 
      {
          api.TessBaseAPISetRectangle(handle, rect.x, rect.y, rect.width, rect.height);
      }
  
      Pointer utf8Text = hocr ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseAPIGetUTF8Text(handle);
      String str = utf8Text.getString(0);
      api.TessDeleteText(utf8Text);
      api.TessBaseAPIDelete(handle);
  
      return str;
  }
  }
  </code></pre>
  
  <p>I'm using tesseract for the first time please tell me what I'm doing wrong.</p>