AmitGorvadiya / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

I think the revision 236 does not work properly. You can never know the directory where is running the dll because the code never reaches the basedir.cpp's line 101 #219

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put the version 2.04 instead of 2.03
2.
3.

What is the expected output? 
The same

What do you see instead?
The aplication does not find the configs file.

What version of the product are you using? On what operating system?

Please provide any additional information below.
The problem is at line 97 of basedir.cpp:
if (code == NULL) {

the condition is bad it must be != 
if (code != NULL) {

Original issue reported on code.google.com by andresl...@gmail.com on 8 Jul 2009 at 12:27

GoogleCodeExporter commented 9 years ago
Sorry my english

Original comment by andresl...@gmail.com on 8 Jul 2009 at 12:28

GoogleCodeExporter commented 9 years ago
If you reverse the condition as you suggest, then it segfaults if code == NULL. 
I
don't see what your problem is.

Original comment by theraysm...@gmail.com on 19 May 2010 at 10:56

GoogleCodeExporter commented 9 years ago
I will try to explain as better as i can:

I instance in my windows program the next line (like in the example):

   TessDllAPI Ocr_api(MyLanguage); // MyLanguage="spa"

This line goes to tessdll.cpp line 79:
   init_tesseract ("TESSEDIT", "tessapi", lang, 0L, 1, fake_argv);
that goes to tessedit.cpp line 168:
   init_tesseract_lang_data (arg0, textbase, language, configfile, configc, onfigv);
that goes to tessedit.cpp line 124:
   main_setup(arg0, textbase, configc, configv);
that goes to mainblk.cpp line 81:
    if (argv0 != NULL) {
       if (getpath(argv0, datadir) < 0)
that goes to the function getpath because argv0 is NOT NULL

because is not NULL and the "directory" variable have garbage because is not 
init.
Then garbage + "TESSEDIT" crash the program
If i chage the condition all works fine.

Now in detail i see that probably mi solution does not work if the first 
parameter is
NULL

Sorry my very bad english I hope you anderstand my exposition.

Original comment by andresl...@gmail.com on 20 May 2010 at 8:49