I am using GraphicsMagick.
This is the image:
which I used for cropping:
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:
Why is white background not working in the transparent portion? Any idea how to resolve this?
Aucun commentaire:
Enregistrer un commentaire