zamf commented on code in PR #2769:
URL: https://github.com/apache/tika/pull/2769#discussion_r3100127890


##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-encode-module/src/main/java/org/apache/tika/parser/ocrencode/EncodeOCRConfig.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.ocrencode;
+
+import java.io.Serializable;
+
+/**
+ * Configuration for EncodeOCRParser. This class is not thread safe and must be
+ * synchronized externally.
+ */
+public class EncodeOCRConfig implements Serializable {
+
+    private static final long serialVersionUID = -1761942486845717891L;
+
+    // Default maximum size of a single image accepted for base64 encoding.
+    // Base64 output is ~4/3 the input size, and the encoded characters are
+    // buffered in the XHTML content handler, so keep this conservative by
+    // default. Override via config to raise for larger workloads.
+    public static final long DEFAULT_MAX_FILE_SIZE_TO_OCR = 100L * 1024 * 1024;
+
+    private long maxFileSizeToOcr = DEFAULT_MAX_FILE_SIZE_TO_OCR;
+    private long minFileSizeToOcr = 0;
+    private boolean skipOcr = false;
+    private int maxImagesToOcr = 50;
+    private boolean inlineContent = false;
+
+    public void setInlineContent(boolean inlineContent) {
+        this.inlineContent = inlineContent;
+    }
+
+    public boolean isInlineContent() {
+        return inlineContent;
+    }
+
+    /**
+     * @see #setMinFileSizeToOcr(long minFileSizeToOcr)
+     */
+    public long getMinFileSizeToOcr() {
+        return minFileSizeToOcr;
+    }
+
+    /**
+     * Set minimum file size to submit file to ocr. Default is 0.
+     */
+    public void setMinFileSizeToOcr(long minFileSizeToOcr) {
+        this.minFileSizeToOcr = minFileSizeToOcr;
+    }
+
+    /**
+     * @see #setMaxFileSizeToOcr(long maxFileSizeToOcr)
+     */
+    public long getMaxFileSizeToOcr() {
+        return maxFileSizeToOcr;
+    }
+
+    /**
+     * Set maximum file size (in bytes) to submit file to ocr. Default is
+     * {@value #DEFAULT_MAX_FILE_SIZE_TO_OCR} bytes (100 MB).
+     */
+    public void setMaxFileSizeToOcr(long maxFileSizeToOcr) {
+        this.maxFileSizeToOcr = maxFileSizeToOcr;
+    }
+
+    public boolean isSkipOcr() {
+        return skipOcr;
+    }
+
+    /**
+     * If you want to turn off OCR at run time for a specific file, set this to
+     * <code>true</code>
+     *
+     * @param skipOcr
+     */
+    public void setSkipOcr(boolean skipOcr) {
+        this.skipOcr = skipOcr;
+    }
+
+    public int getMaxImagesToOcr() {
+        return maxImagesToOcr;
+    }
+
+    /**
+     * Sets the maximum number of images to process with OCR per parse. Default
+     * is 50.
+     *

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to