-
Notifications
You must be signed in to change notification settings - Fork 567
Open
Description
https://cloud.google.com/document-ai/docs/process-documents-client-libraries following this documentation on making a request to individual document processing.
According to the below screenshot, we need to send a base64 encoded image.

But https://cloud.google.com/document-ai/docs/process-documents-client-libraries suggests without encoding approach.
content = File.binread file_path
Both approaches:
On making a request without base64 encoding, getting the below error:
**An error occurred when inspecting the object: #<ArgumentError: invalid byte sequence in UTF-8>
Result of Kernel#inspect: #<Google::Cloud::DocumentAI::V1::ProcessResponse:0x0000000128b78670 @descriptor=#<Google::Protobuf::Descriptor:0x0000000125b89ec8>>**
On making a request with base64 encoding, getting the below error:
bin_file = File.binread file_path
content = Base64.strict_encode64(bin_file)
**3:Invalid image content. debug_error_string:{UNKNOWN:Error received from peer ipv6:%5B2404:6800:4007:81e::200a%5D:443 {created_time:"2024-05-24T14:54:57.103571+05:30", grpc_status:3, grpc_message:"Invalid image content"}} (Google::Cloud::InvalidArgumentError)**
Metadata
Metadata
Assignees
Labels
No labels