dibe84
Posts: 0
Joined: Fri Dec 06, 2013 11:20 am

Error rendering an image from DB: parse error

Hey guys,
I'm facing a problem rendering an image from the DB and i'm getting crazy!
I'm calling the service query the Files database like that:

https://api.appery.io/rest/1/db/files...

with the REST TEST it works fine, but the response contains a JSON with an error (take a look to the screenshot) and my app is not able to parse it. In fact when i call it in the real application (not rest test) it returns: parse error.

The base64 string seems to be valid and if i remove the "new line" chars (with notepad++ for example i repalce "\r\n" with anything) also the JSON error disappears.

Any idea?

Thanks a lot,
Gabriele

Image

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Error rendering an image from DB: parse error

Hello Gabriele,

We'll check and let you know asap.
Please try to recreate Service and test if it works.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Error rendering an image from DB: parse error

Hi Gabriele,

Please try removing parameter 'encoded'.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Error rendering an image from DB: parse error

Sorry, this is a standard behaviour after the latest Appery.io release. You would need to use a separate service for retrieving objects list.

dibe84
Posts: 0
Joined: Fri Dec 06, 2013 11:20 am

Error rendering an image from DB: parse error

Hi Katya, thank you for the answer. I tried to remove the parameter "encoded" but the answer is horrible, somethiing like that:

�PNG
IHDR V @\�� sRGB�� � gAMA�� �a pHYs � � �o�d��IDATx�� x ��5
� w�a��3\��?��� N�lZ�ѧO:��s j�s�9���

So i think i need the encoding paramter to get the image in base64 format.

I didn't understand you second statament: I don't need to retriev the object list because I already have the image_name stored....

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Error rendering an image from DB: parse error

Hello! Sorry for a late reply. Add the following JS prereturn "data:image/png;base64," + value;/pre See the screenshot
Image

dibe84
Posts: 0
Joined: Fri Dec 06, 2013 11:20 am

Error rendering an image from DB: parse error

Thank you Maryna for the answer. The specified JS code is already in place, problem's I receive the "parse error" before the calling of that JS... even if I remove the connection arrow between the response and the asset I'd receive the error....

Gabriele

dibe84
Posts: 0
Joined: Fri Dec 06, 2013 11:20 am

Error rendering an image from DB: parse error

The strange thing is that this logic used to work before... :(

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Error rendering an image from DB: parse error

Hi Gabriele,

Please post a public link to your app. We would need to take a look.

dibe84
Posts: 0
Joined: Fri Dec 06, 2013 11:20 am

Error rendering an image from DB: parse error

Hi Katya,

http://appery.io/app/view/2dc7c512-e9...

basically I'm trying to read the image with the name passed through the parameter image_name.

But the basic question is: take a look at the first screenshot I inserted... it's normal that the editor highlines with a red error the base64 code provided by the service response? it seems to contain some line-breaks that screw-up the parser, it happens with the images I uploaded in DB trough the standard feature as well.
Very strange, isn't it? I think there's something wrong with the request.

Return to “Issues”