user1025852 user1025852 - 1 year ago 169
Node.js Question

cloudinary crop with node.js doesn't work?

I uploaded some image to cloudinary - tried to manipulate (crop) the image but get the same image url (not cropped) - bug in cloudinary npm or I miss something?

var cloudinary = require('cloudinary');
var sourceUrl = cloudinaryImageDetails.url;
var croppedUrl = cloudinary.url(sourceUrl, {
height: 30,

Answer Source

cloudinary.url works when supplied with the public_id of the uploaded image as first argument (instead of full image's URL).

For example,

cloudinary.url (`public_id`, { width:30, height: 30, crop:'fill' })

outputs -,h_30,w_30/public_id
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download