I am attempting to OCR a picture taken with a mobile phone within my native application built with the Cordova mobile application development platform. I get the following error when I attempt to process the image.
<?xml version="1.0" encoding="utf-8"?><error><message language="english">Unsupported image file format</message></error>
The error is returned when I post the jpeg image to the Cloud OCR processImage method:
I am also sending the "Content-Type: image/jpeg" header to identify the content.
The picture I am sending was taken with the phone and saved to the local file system on the phone. When I read the picture from the local file system with Cordova I have several options: readAsDataURL, readAsText, readAsBinaryString, and readAsArrayBuffer. I have tried them all and get the same error. These different options are documented here: Cordova FileReader Methods.