In my Java project I'm using Google Cloud Vision API to extract text from images. For text extraction I'm using the following piece of code.
Today, I've found that Google has changed the limits for maximum file size. Previously it was 4 MB.
Now, based on Quotas and Limits and Supported Images, the maximum image file size should be 20 MB for images hosted on Cloud Storage or at a publicly-accessible URL. Also there is maximum JSON request object size (10 MB).
I'm using option with images hosted on Cloud Storage. For images larger than ~7.95 MB (12000 x 6500) I'm getting an error message:
responses {
error {
code: 3
message: "Invalid image contents: gs://... ."
}
}
For images with lower size I'm getting correct response. I know that there is a recommended size 1024 x 768 for TEXT_DETECTION and DOCUMENT_TEXT_DETECTION feature but, according to the following note, higher size should not be problem:
Note: generally, the Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy.
Is there something I did not notice?
Note: I'm getting the same error when calling the Vision API directly (see Bearer tokens section).