sharp/index.js

19 lines
553 B
JavaScript
Executable File

var sharp = require("./build/Release/sharp");
module.exports.buffer = {
jpeg: "__jpeg",
png: "__png"
};
module.exports.crop = function(input, output, width, height, callback) {
sharp.resize(input, output, width, height, "c", callback);
};
module.exports.embedWhite = function(input, output, width, height, callback) {
sharp.resize(input, output, width, height, "w", callback);
};
module.exports.embedBlack = function(input, output, width, height, callback) {
sharp.resize(input, output, width, height, "b", callback);
};