Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

busted in v4: process from file list #665

Closed
jbreiden opened this issue Jan 18, 2017 · 3 comments
Closed

busted in v4: process from file list #665

jbreiden opened this issue Jan 18, 2017 · 3 comments

Comments

@jbreiden
Copy link
Contributor

jbreiden commented Jan 18, 2017

v3.0.4 works, v4.0.0 fails

$ echo phototest.tif > manifest
$ tesseract manifest - -
This is a lot of 12 point text to test the
ocr code and see if it works on all types
of file format.

The quick brown dog jumped over the
lazy fox. The quick brown dog jumped
over the lazy fox. The quick brown dog
jumped over the lazy fox. The quick
brown dog jumped over the lazy fox.
$ echo phototest.tif > manifest
$ tesseract manifest - -
Error during processing.
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a69316a0 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatalstm-punc-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a694a140 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatalstm-word-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a6dc2650 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatalstm-number-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a6dc25c0 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatapunc-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a6de0260 still has count 1 (id third_party/tesseract/tessdata/eng.traineddataword-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a69314f0 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatanumber-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a6de1e80 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatabigram-dawg)
ObjectCache(0xb408678)::~ObjectCache(): WARNING! LEAK! object 0x7ff6a6de1d60 still has count 1 (id third_party/tesseract/tessdata/eng.traineddatafreq-dawg)
@jbreiden jbreiden changed the title busted in v4: manifest of image files busted in v4: process from file list Jan 18, 2017
@jbreiden
Copy link
Contributor Author

jbreiden commented Jan 18, 2017

Here's a fix. I don't know if 3.0.5 is busted or not (if I had to guess, yes)

--- api/baseapi.cpp	2016-12-15 15:28:37.000000000 -0800
+++ api/baseapi.cpp	2017-01-18 15:03:52.000000000 -0800
@@ -1083,7 +1083,15 @@
 
   // Maybe we have a filelist
   if (r != 0 || format == IFF_UNKNOWN) {
-    STRING s(buf.c_str());
+    STRING s;
+    if (stdInput) {
+      s = buf.c_str();
+    } else {
+      std::ifstream t(filename);
+      std::string u((std::istreambuf_iterator<char>(t)),
+                    std::istreambuf_iterator<char>());
+      s = u.c_str();
+    }
     return ProcessPagesFileList(NULL, &s, retry_config,
                                 timeout_millisec, renderer,
                                 tesseract_->tessedit_page_number);

@Shreeshrii
Copy link
Collaborator

Shreeshrii commented Jan 19, 2017

Same error (WARNING! LEAK! ) reported in issue

#529 (comment)

@zdenop zdenop closed this as completed in a979494 Jan 19, 2017
zdenop pushed a commit that referenced this issue Jan 19, 2017
@zdenop
Copy link
Contributor

zdenop commented Jan 19, 2017

thanks!

zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/tesseract that referenced this issue Mar 28, 2021
zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/tesseract that referenced this issue Mar 28, 2021
zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/tesseract that referenced this issue Mar 28, 2021
zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/tesseract that referenced this issue Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants