|
From: | Antonio Diaz Diaz |
Subject: | [Bug-ocrad] Re: OCRAD project: library is needed |
Date: | Thu, 15 Jul 2010 18:25:09 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
Dmitry Katsubo wrote:
Igor, can you send me the problematic image? Let's create test2 :)
Yes, please. :-)
1) Why do you use check for "OCRAD_ok" for OCRAD_get_errno() return value, but the rest you compare with "0"?
Because OCRAD_get_errno returns an error code while the other functions return 0 on success.
"Most library functions return -1 or a null pointer to indicate that they have failed. But this return value only tells you that an error has occurred. To find out what kind of error it was, you need to verify the error code by calling `OCRAD_get_errno'".
2) Maybe it makes sense to have a "combined" API function, that will group OCRAD_recognize() + OCRAD_result_characters() + OCRAD_result_first_character() ? This "if"-clause looks thrilling and it horribly grows ...
I think it is not a good idea to lose flexibility just to save two lines of code. Even less in an API not yet mature.
Regards, Antonio.
[Prev in Thread] | Current Thread | [Next in Thread] |