Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

no decode delegate for this image format `' @ error/constitute.c/ReadImage/501. #7

Open
mchun opened this issue Feb 26, 2016 · 18 comments

Comments

@mchun
Copy link

mchun commented Feb 26, 2016

Thanks for creating this repo.
But I wonder if any delegate of imagemagick has to be installed?
I encountered the caption error when executing setData.

Parse.Cloud.httpRequest({ url: url }).then(function(response) {
    // Create an Image from the data.
    var image = new Image();
    return image.setData(response.buffer);
);
@flovilmart
Copy link
Owner

@mchun what platform/system are you running on?

@mchun
Copy link
Author

mchun commented Feb 26, 2016

mac osx 10.10.5
when I do "convert -list configure"
It contains the following, I have no idea what went wrong and currently using jimp instead.
DELEGATES bzlib mpeg freetype jng jpeg lzma png tiff webp xml zlib

@flovilmart
Copy link
Owner

I'm on 10.11.3 and that works like a breeze, on travis the tests passes too.. that's really odd. Seems a mis installation of the couple gm/imagemagick

@carmenlau
Copy link

This is encoding problem. Parse.Cloud.httpRequest is using request.

encoding - Encoding to be used on setEncoding of response data. If null, the body is returned as a Buffer. Anything else (including the default value of undefined) will be passed as the encoding parameter to toString() (meaning this is effectively utf8 by default). (Note: if you expect binary data, you should set encoding: null.)

Set encoding to null can solve the problem for me.

Parse.Cloud.httpRequest({ url: url, encoding: null}).then(function(response) {
    // Create an Image from the data.
    var image = new Image();
    return image.setData(response.buffer);
);

@flovilmart
Copy link
Owner

Good catch! Do you have time for a Pr?

@carmenlau
Copy link

Saw your PR in parse-server for this issues. Thanks a lot and appreciate for your work!

@tsanthosh
Copy link

Hi @flovilmart, Thanks for doing this. I am getting the same error too when trying to download an image from a url using httpRequest. I even tried using encoding = null but still doesn't work. Can you please let me know how I should work around this error.

@flovilmart
Copy link
Owner

can you try without using Parse.Cloud.httpRequest but a simple http request manager and see if it works passing the response buffer to ParseImage

@mcclaskiem
Copy link

mcclaskiem commented Apr 6, 2016

Ive tried two different request clients here and am still getting the same error. Is this something that is occuring across all file adapters or could it be provider specific?

@flovilmart
Copy link
Owner

I'm not sure. where is it deployed? heroku?

@mcclaskiem
Copy link

Im running it locally on 10.10.5

@flovilmart
Copy link
Owner

uhm, never had that issue on mac...

@mcclaskiem
Copy link

both graphmagick and imagemagick are installed via homebrew, is there something I can check to confirm with confirm -list configure

@flovilmart
Copy link
Owner

Can you try cloning the repo and run the tests? With npm run tests?

@mcclaskiem
Copy link

Got 8 passing here, must be something with the response that I am passing.

@flovilmart
Copy link
Owner

yup that's most likely, make sure that's a proper buffer with an image in it :)

@mcclaskiem
Copy link

Where do you suggest posting to verify a FileAdapter? I have one written for RackSpace but would like to make sure its conformant to parse-server

@flovilmart
Copy link
Owner

try locally with your code to save the buffer as a file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants