File extension for OCR

Can you post the error message you’re getting?

Also, when you use a block with a green “error” block result, you should check the value of that block. When you preview your project, what are the values of the two green “error” blocks?

I changed the last part of my blocks and this is the error message that I’m getting.

image

I haven’t used that API but I’m guessing it might need the photo block, not the url. You may need to check the documentation for that.

Have you tested this with a mobile device?

@codeswept might have a better idea since they have worked on an OCR app

And just an aside since I changed the size of the image you posted to make it a bit smaller, you can do that with any image you paste/upload in the forums by adding a comma followed by a percentage after the resolution. For example, I added “,40%” to yours:

image

See this for more info.

2 Likes

Yes, I have tested this on a mobile device. I got the error message after testing it on a mobile device. I have also messaged @codeswept and I am patiently waiting for an answer :slight_smile:

1 Like

In your block Web API URL you are adding the green block URL to the end of your URL.

Try adding the green block photo instead. It should work with the photo not the URL of the photo.

1 Like

I have tried replacing the “url” block with the “photo” block from the “photo from camera” part, but it still does not seem to be working. I am getting the same error.

1 Like

Select a photo file from the gallery with different extension to use it as the input for the API. It could be the API is not recognising all image extensions.

Okay, I will try doing that! But how do I let it know that I want the words that it scanned to be outputted in a list or label?

I tried this Example API and it is working fine and I got the following response

{"ParsedResults":[{"TextOverlay":{"Lines":[],"HasOverlay":false,"Message":"Text overlay is not provided as it is not requested"},"TextOrientation":"0","FileParseExitCode":1,"ParsedText":"GAVE AWAY MY BOOK\r\nFREE ON\r\nREACHED TOP OF AMAZON\r\nBESTSELLER\r\n","ErrorMessage":"","ErrorDetails":""}],"OCRExitCode":1,"IsErroredOnProcessing":false,"ProcessingTimeInMilliseconds":"359","SearchablePDFURL":"Searchable PDF not generated as it was not requested."}

Can you make sure you have the correct url in your blocks

Are you talking about the web API url?

1 Like

I am talking about the free version of the same API you are using.

Just to explain more. This is the image I’m using test image and in the response of the API you can see the following text GAVE AWAY MY BOOK\r\nFREE ON\r\nREACHED TOP OF AMAZON\r\nBESTSELLER\r\n which means that it is working fine

1 Like

I think it’s kind of working, but this is the error message that I am getting now:
“{“OCRExitCode”:3,“IsErroredOnProcessing”:true,“ErrorMessage”:[“File failed validation. File size exceeds the maximum size limit. Maximum size limit 1024 KB”],“ErrorDetails”:”",“ProcessingTimeInMilliseconds”:“31”}"

1 Like

I have also checked the size of my image and it says that it is 926KB, which is less than 1024KB. So I don’t really know what the problem is.

1 Like

I can’t really provide any comments without testing the URL and image that you are using resulting in this error.

Unfortunately, if I share the url, I would have to share my API key. Is there anything you think might be the problem? Maybe you could check your blocks with mine?

1 Like

Sorry, I will not be of help to you in this case.

But did you change the blocks in any way? Are my blocks different from yours? Also, why do you need the url? are we not using the same one? It is this one: https://api.ocr.space/parse/imageurl?apikey=YOURAPIKEY&url=

I don’t have the time or energy to play this game. You are seeking my help but do NOT want to trust me on the API key.

Try this replace your API key with what’s in the URL.

Good luck.

Could you at least post your blocks so I can compare mine with yours? That’s what I’ve been asking for the past few messages.
Thank you.

1 Like