Skip to content

Instantly share code, notes, and snippets.

@mcs07
Created March 5, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcs07/fa0ade14709f55d4523c9454a193f824 to your computer and use it in GitHub Desktop.
Save mcs07/fa0ade14709f55d4523c9454a193f824 to your computer and use it in GitHub Desktop.
Patch osra lib v2.1.0
diff --git a/src/osra_lib.cpp b/src/osra_lib.cpp
index 4262e83..48979ae 100644
--- a/src/osra_lib.cpp
+++ b/src/osra_lib.cpp
@@ -635,7 +635,7 @@ int osra_process_image(
if (type.empty() || type == "PDF" || type == "PS")
{
#ifdef OSRA_LIB
- poppler_doc = load_from_raw_data(image_data, image_length);
+ poppler_doc = poppler::document::load_from_raw_data(image_data, image_length);
#else
poppler_doc = poppler::document::load_from_file(input_file);
#endif
@@ -649,10 +649,12 @@ int osra_process_image(
{
type.clear();
}
+#ifndef OSRA_LIB
else if (!type.empty() && type != "PDF")
{
page = count_pages(input_file);
}
+#endif
// dup2(stderr_copy, 2);
//close(stderr_copy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment