Bytes parameter in rekognition throws "Request has invalid image format" error
See original GitHub issueNode version: v8.11.3 Npm version: 6.4.1 SDK version: 2.335.0
Bytes parameter not recognizing base64 encoded string “image/png;base64,Qk02EA…” and throwing error “InvalidImageFormatException: Request has invalid image format” when i try to make the request. I also tried with:
- Buffer
- Blob
- Typed Array
They all display the same error. Test case:
let params = {
Image: {
Bytes: 'BASE_64_STRING'
},
};
rekognition.detectFaces(params, function(err, data) {
if (err) {console.log(err, err.stack)}
else console.log(JSON.stringify(data);
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
error InvalidImageFormatException: Request has invalid ...
This image is a jpeg 250px square and was sent as a valid base64 string (atob tested). Aparently, it meets the requisites presented...
Read more >Error handling - Amazon Rekognition - AWS Documentation
Describes how to handle client and server errors returned by Amazon DynamoDB operations. ... Message: Request has invalid image format.
Read more >AWS Rekognition JS SDK Invalid image encoding error-Reactjs
In case someone is doing this on the Node side, I was running into a similar issue when reading in a file in...
Read more >Error messages - Resource Manager - Google Cloud
badRequest, The API request is invalid or improperly formed. ... The alt parameter value specifies an output format that is not supported for...
Read more >RekognitionClient | aws-sdk-swift
If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes isn't supported. The image must be formatted as a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you give an example of how you are setting up the Bytes (or Buffer, Blob, Typed Array)?
This Buffer example should work for you:
Could you also try using uploading the same image to the Rekognition Console?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.