jeudi 26 février 2015

GraphicsMagick using nodejs not returning correct image

I am using GraphicsMagick.


This is the image:


http://ift.tt/1FrCsXu


which I used for cropping:


enter image description here


My code is here:



gm(request(url), "myimage.jpeg")
.resize(270, 270, '^')
.gravity('Center')
.quality(50)
.crop(270,270)
.compress('JPEG')
.flatten()
.stream(function (err, stdout, stderr) {
if (err)
console.log(err);
else {
//upload the file
file.uploadFileFromGm(fileDetails, stdout, cb);
}
});


The code is working fine.


But I got an transparent image which is empty on left side.


I got the following image as a result:


enter image description here


Why is white background not working in the transparent portion? Any idea how to resolve this?


Aucun commentaire:

Enregistrer un commentaire