justaddcoffee / tesseract-ocr

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

uninitialized (or stupid) values returned by WordFontAttributes if word contains no text #1334

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When no text is recognised under the current word, pointsize (and perhaps other 
attrs) returned from WordFontAttributes are uninitialized. They should be 
sensible defaults or throw an error. It is strange that at the same time 
res_it->Empty(RIL_WORD) is not being hit - earlier in the code we have a test 
for that...

          const char *font_name = res_it->WordFontAttributes(&bold, &italic, &underlined,
                                            &monospace, &serif, &smallcaps,
                                            &pointsize, &font_id);

          const char *text = res_it->GetUTF8Text(RIL_WORD);
          cout << pointsize << "pt " << strlen(text) << endl;

outputs:

527821968pt 0
15pt 11
15pt 11
15pt 5
15pt 6
15pt 5
15pt 10
15pt 6
15pt 5
15pt 8
15pt 11
15pt 4
15pt 12

Original issue reported on code.google.com by zea...@gmail.com on 10 Oct 2014 at 6:33

GoogleCodeExporter commented 9 years ago
Can you post a test case (at least image) for this issue?

Original comment by zde...@gmail.com on 8 Feb 2015 at 10:23