You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by dm...@apache.org on 2018/01/14 22:51:19 UTC

[tika] branch master updated (7f6072c -> 5f3102f)

This is an automated email from the ASF dual-hosted git repository.

dmeikle pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git.


    from 7f6072c  Merge branch 'BenRomberg-TIKA-1191'
     new 0b9aa9b  TIKA-2509: Updated to use configured ImageMagick path
     new 214b892  TIKA-2509: Updated to ignore python warnings during rotation script
     new 5f3102f  TIKA-2509: Updated to use configured ImageMagick path

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.txt                                                    |  3 +++
 .../java/org/apache/tika/parser/ocr/TesseractOCRParser.java    | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@tika.apache.org" <co...@tika.apache.org>'].

[tika] 02/03: TIKA-2509: Updated to ignore python warnings during rotation script

Posted by dm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dmeikle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 214b8923fdf0dae1e6866d5b75f4780306842c0d
Author: David Meikle <da...@meikle.io>
AuthorDate: Sun Jan 14 22:31:12 2018 +0000

    TIKA-2509: Updated to ignore python warnings during rotation script
---
 .../src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
index 15d3c58..08847fd 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
@@ -323,7 +323,7 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
     	File rotationScript = tmp.createTemporaryFile();
     	Files.copy(in, rotationScript.toPath(), StandardCopyOption.REPLACE_EXISTING);
     	
-    	String cmd = "python " + rotationScript.getAbsolutePath() + " -f " + streamingObject.getAbsolutePath();
+    	String cmd = "python -W ignore " + rotationScript.getAbsolutePath() + " -f " + streamingObject.getAbsolutePath();
     	String angle = "0"; 
     			
     	DefaultExecutor executor = new DefaultExecutor();

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.

[tika] 03/03: TIKA-2509: Updated to use configured ImageMagick path

Posted by dm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dmeikle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 5f3102fc80b8bb8ef919153e000a0f7258621cba
Author: David Meikle <da...@meikle.io>
AuthorDate: Sun Jan 14 22:33:03 2018 +0000

    TIKA-2509: Updated to use configured ImageMagick path
---
 CHANGES.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGES.txt b/CHANGES.txt
index 6645a9f..ef3f102 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,9 @@ Release 2.0.0 - ???
 
    * Mime magic for Dolby Digital AC3 and EAC3 files
 
+   * Fixed bug where TesseractOCRParser ignores configured ImageMagickPath,
+     and set rotation script to ignore Python warnings (TIKA-2509)
+
 Release 1.17 - 12/8/2017
 
   ***NOTE: THIS IS THE LAST VERSION OF TIKA THAT WILL RUN

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.

[tika] 01/03: TIKA-2509: Updated to use configured ImageMagick path

Posted by dm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dmeikle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 0b9aa9b5efde795f6b863c987abff5be07530a41
Author: David Meikle <da...@meikle.io>
AuthorDate: Sun Jan 14 22:29:59 2018 +0000

    TIKA-2509: Updated to use configured ImageMagick path
---
 .../main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
index 1bf229b..15d3c58 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
@@ -154,7 +154,7 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
     
     private boolean hasImageMagick(TesseractOCRConfig config) {
         // Fetch where the config says to find ImageMagick Program
-        String ImageMagick = config.getImageMagickPath() + getImageMagickProg();
+        String ImageMagick = getImageMagickPath(config);
 
         // Have we already checked for a copy of ImageMagick Program there?
         if (TESSERACT_PRESENT.containsKey(ImageMagick)) {
@@ -170,6 +170,10 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
      
     }
 
+    private String getImageMagickPath(TesseractOCRConfig config) {
+        return config.getImageMagickPath() + getImageMagickProg();
+    }
+
     static boolean hasPython() {
         // check if python is installed and it has the required dependencies for the rotation program to run
         boolean hasPython = false;
@@ -339,7 +343,7 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
         }
               
         // process the image - parameter values can be set in TesseractOCRConfig.properties
-    	String line = "convert -density " + config.getDensity() + " -depth " + config.getDepth() + 
+    	String line = getImageMagickPath(config) + " -density " + config.getDensity() + " -depth " + config.getDepth() +
     			" -colorspace " + config.getColorspace() +  " -filter " + config.getFilter() + 
     			" -resize " + config.getResize() + "% -rotate "+ angle + " " + streamingObject.getAbsolutePath() + 
     			" " + streamingObject.getAbsolutePath();    	

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.