How to use the cloudinary.v2.url function in cloudinary

To help you get started, we’ve selected a few cloudinary examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudinary / cloudinary_npm / samples / basic / basic.js View on Github external
function performTransformations() {
  console.log();
  console.log();
  console.log();
  console.log(">> >> >> >> >> >> >> >> >> >>  Transformations << << << << << << << << << <<");
  console.log();
  console.log("> Fit into 200x150");
  console.log("> " + cloudinary.url(uploads.pizza2.public_id, { width: 200, height: 150, crop: "fit", format: "jpg" }));

  console.log();
  console.log("> Eager transformation of scaling to 200x150");
  console.log("> " + cloudinary.url(uploads.lake.public_id, eager_options));

  console.log();
  console.log("> Face detection based 200x150 thumbnail");
  console.log("> " + cloudinary.url(uploads.couple.public_id, { width: 200, height: 150, crop: "thumb", gravity: "faces", format: "jpg" }));

  console.log();
  console.log("> Fill 200x150, round corners, apply the sepia effect");
  console.log("> " + cloudinary.url(uploads.couple2.public_id, { width: 200, height: 150, crop: "fill", gravity: "face", radius: 10, effect: "sepia", format: "jpg" }));

  console.log();
  console.log("> That's it. You can now open the URLs above in a browser");
  console.log("> and check out the generated images.");
}
github cloudinary / cloudinary_npm / samples / basic / basic.js View on Github external
function performTransformations() {
  console.log();
  console.log();
  console.log();
  console.log(">> >> >> >> >> >> >> >> >> >>  Transformations << << << << << << << << << <<");
  console.log();
  console.log("> Fit into 200x150");
  console.log("> " + cloudinary.url(uploads.pizza2.public_id, { width: 200, height: 150, crop: "fit", format: "jpg" }));

  console.log();
  console.log("> Eager transformation of scaling to 200x150");
  console.log("> " + cloudinary.url(uploads.lake.public_id, eager_options));

  console.log();
  console.log("> Face detection based 200x150 thumbnail");
  console.log("> " + cloudinary.url(uploads.couple.public_id, { width: 200, height: 150, crop: "thumb", gravity: "faces", format: "jpg" }));

  console.log();
  console.log("> Fill 200x150, round corners, apply the sepia effect");
  console.log("> " + cloudinary.url(uploads.couple2.public_id, { width: 200, height: 150, crop: "fill", gravity: "face", radius: 10, effect: "sepia", format: "jpg" }));

  console.log();
  console.log("> That's it. You can now open the URLs above in a browser");
  console.log("> and check out the generated images.");
}
github cloudinary / cloudinary_npm / samples / basic / basic.js View on Github external
function performTransformations() {
  console.log();
  console.log();
  console.log();
  console.log(">> >> >> >> >> >> >> >> >> >>  Transformations << << << << << << << << << <<");
  console.log();
  console.log("> Fit into 200x150");
  console.log("> " + cloudinary.url(uploads.pizza2.public_id, { width: 200, height: 150, crop: "fit", format: "jpg" }));

  console.log();
  console.log("> Eager transformation of scaling to 200x150");
  console.log("> " + cloudinary.url(uploads.lake.public_id, eager_options));

  console.log();
  console.log("> Face detection based 200x150 thumbnail");
  console.log("> " + cloudinary.url(uploads.couple.public_id, { width: 200, height: 150, crop: "thumb", gravity: "faces", format: "jpg" }));

  console.log();
  console.log("> Fill 200x150, round corners, apply the sepia effect");
  console.log("> " + cloudinary.url(uploads.couple2.public_id, { width: 200, height: 150, crop: "fill", gravity: "face", radius: 10, effect: "sepia", format: "jpg" }));

  console.log();
  console.log("> That's it. You can now open the URLs above in a browser");
  console.log("> and check out the generated images.");
github cloudinary / cloudinary_npm / samples / basic / basic.js View on Github external
console.log(">> >> >> >> >> >> >> >> >> >>  Transformations << << << << << << << << << <<");
  console.log();
  console.log("> Fit into 200x150");
  console.log("> " + cloudinary.url(uploads.pizza2.public_id, { width: 200, height: 150, crop: "fit", format: "jpg" }));

  console.log();
  console.log("> Eager transformation of scaling to 200x150");
  console.log("> " + cloudinary.url(uploads.lake.public_id, eager_options));

  console.log();
  console.log("> Face detection based 200x150 thumbnail");
  console.log("> " + cloudinary.url(uploads.couple.public_id, { width: 200, height: 150, crop: "thumb", gravity: "faces", format: "jpg" }));

  console.log();
  console.log("> Fill 200x150, round corners, apply the sepia effect");
  console.log("> " + cloudinary.url(uploads.couple2.public_id, { width: 200, height: 150, crop: "fill", gravity: "face", radius: 10, effect: "sepia", format: "jpg" }));

  console.log();
  console.log("> That's it. You can now open the URLs above in a browser");
  console.log("> and check out the generated images.");
}
github eexit / ghost-storage-cloudinary / index.js View on Github external
return new Promise((resolve, reject) => cloudinary.uploader.upload(imagePath, options, (err, res) => {
            if (err) {
                return reject(new common.errors.GhostError({
                    err: err,
                    message: `Could not upload image ${imagePath}`
                }));
            }
            if (url) {
                return resolve(cloudinary.url(res.public_id.concat('.', res.format), fetchOptions));
            }
            return resolve();
        }));
    }