broccoli-image-resize
v0.2.1
Published
A plugin to resize images in trees to proper sizes and/or thumbnails
Downloads
1
Readme
Broccoli Image Resize
A plugin to resize images as part of a Broccoli build. This plugin uses sharp to do the image resizing.
Usage
The following example (when run on an input of test.png
) will produce
test.png
at a width of 640 with auto height, and a test-th.png
at exactly
100 width and 100 height (cropped).
var BroccoliImageResize = require('broccoli-image-resize');
var outputNode = new BroccoliImageResize(inputNodes, {
sizes: {
default: [640],
th: [100, 100]
}
});
Options
| Option | Description | | -- | -- | | sizes | The arguments to sharp's resize function as an array | | withoutEnlargement | If set to a truthy value, then the image will never be enlarged | | annotation | An annotation for the Broccoli plugin output |