Giter Site home page Giter Site logo

Comments (7)

jbreiden avatar jbreiden commented on April 28, 2024

change written, currently under review

from tesseract.

jbreiden avatar jbreiden commented on April 28, 2024

Change is in Ray's hands and will eventually migrate here. The person in critical need has a copy.

from tesseract.

amitdo avatar amitdo commented on April 28, 2024

@jbreiden, we didn't get the patch.
https://github.com/tesseract-ocr/tesseract/blob/2c837dffc3/api/renderer.cpp#L71

from tesseract.

amitdo avatar amitdo commented on April 28, 2024

cc: @theraysmith

from tesseract.

jbreiden avatar jbreiden commented on April 28, 2024

This was the patch. I strongly suspect it made it in.

--- tesseract/api/baseapi.cpp   2015-06-12 17:25:51.000000000 -0700
+++ tesseract/api/baseapi.cpp   2015-08-18 17:46:15.000000000 -0700
@@ -991,8 +991,7 @@
   }
 
   // Begin producing output
-  const char* kUnknownTitle = "";
-  if (renderer && !renderer->BeginDocument(kUnknownTitle)) {
+  if (renderer && !renderer->BeginDocument(unknown_title_)) {
     return false;
   }
 
@@ -1166,8 +1165,7 @@
   }
 
   // Begin the output
-  const char* kUnknownTitle = "";
-  if (renderer && !renderer->BeginDocument(kUnknownTitle)) {
+  if (renderer && !renderer->BeginDocument(unknown_title_)) {
     pixDestroy(&pix);
     return false;
   }
--- tesseract/api/baseapi.h     2015-03-09 15:43:40.000000000 -0700
+++ tesseract/api/baseapi.h     2015-08-18 17:52:49.000000000 -0700
@@ -879,6 +879,12 @@
                                  int timeout_millisec,
                                  TessResultRenderer* renderer,
                                  int tessedit_page_number);
+  // There's currently no way to pass a document title from the
+  // Tesseract command line, and we have multiple places that choose
+  // to set the title to an empty string. Using a single named
+  // variable will hopefully reduce confusion if the situation changes
+  // in the future.
+  const char *unknown_title_ = "";
 };  // class TessBaseAPI.
 
 /** Escape a char string - remove &<>"' with HTML codes. */
--- tesseract/api/renderer.h    2014-08-12 11:22:47.000000000 -0700
+++ tesseract/api/renderer.h    2015-08-18 17:17:41.000000000 -0700
@@ -77,7 +77,7 @@
     bool EndDocument();
 
     const char* file_extension() const { return file_extension_; }
-    const char* title() const { return title_; }
+    const char* title() const { return title_.c_str(); }
 
     /**
      * Returns the index of the last image given to AddImage
@@ -126,7 +126,7 @@
 
   private:
     const char* file_extension_;  // standard extension for generated output
-    const char* title_;           // title of document being renderered
+    STRING title_;                // title of document being renderered
     int imagenum_;                // index of last image added
 
     FILE* fout_;                  // output file pointer

from tesseract.

jbreiden avatar jbreiden commented on April 28, 2024

Yes, it went in as part of this commit.

c1c1e42

from tesseract.

amitdo avatar amitdo commented on April 28, 2024

Since you originally linked to renderer.cpp, I thought that the patch will be in that file.

I'm sorry for the mistake.

from tesseract.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.