From a027dca007daabd233963108b238588510fa339d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 5 Sep 2021 16:45:21 +0200 Subject: [PATCH] Extend URI support for Tesseract with libcurl libcurl not only supports HTTP and HTTPS, but also a lot of other protocols, for example FTP and SFTP. Those protocols can also be useful for Tesseract. Signed-off-by: Stefan Weil --- src/api/baseapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 34d40be9..2476c395 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -1142,7 +1142,7 @@ bool TessBaseAPI::ProcessPagesInternal(const char *filename, const char *retry_c if (stdInput) { buf.assign((std::istreambuf_iterator(std::cin)), (std::istreambuf_iterator())); data = reinterpret_cast(buf.data()); - } else if (strncmp(filename, "http:", 5) == 0 || strncmp(filename, "https:", 6) == 0) { + } else if (strstr(filename, "://") != nullptr) { // Get image or image list by URL. #ifdef HAVE_LIBCURL CURL *curl = curl_easy_init(); -- GitLab