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:

https://cloud.ocrsdk.com/processImage?profile=textExtraction&imageSource=auto&readBarcodes=false&exportFormat=txt

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.

asked 05 Aug '14, 01:08

ericpres's gravatar image

ericpres
112

edited 05 Aug '14, 18:09

Anastasia%20Galimova's gravatar image

Anastasia Ga... ♦♦
790112


We have not got a ready sample code or instructions for using ABBYY Cloud OCR SDK in Apache Cordova. According to Cordova web-site, this framework supports JavaScript. We also have a sample on this language: http://ocrsdk.com/documentation/code-samples/. But we have not found which modules of JavaScript can be used in this framework. Our sample uses library from node .js, and if Cordova supports it, JavaScript sample should work.

To debug your code we recommend to use any HTTP debugger (for example, Fiddler). You can send to CloudOCRSDK@abbyy.com the log to get additional recommendations.

link
This answer is marked "community wiki".

answered 05 Aug '14, 18:07

Anastasia%20Galimova's gravatar image

Anastasia Ga... ♦♦
790112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×160
×59
×4

Asked: 05 Aug '14, 01:08

Seen: 2,172 times

Last updated: 05 Aug '14, 18:09

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal