0.0.3 • Published 6 years ago
gulp-pathcrop v0.0.3
gulp-autocrop
Cloned from my project https://gitlab.com/michaelmarkie/gulp-autocrop/
It will only resize and crop your image any quality adjustments need to be done in another gulp plugin such as imagemin.
Install
npm install gulp-pathcropUsage
const { src, dest } = require('gulp');
const pathcrop = require('gulp-pathcrop');
function imageTask (cb) {
    src('src/*.png')
        .pipe(pathcrop())
        .pipe(dest('output'))
        .on('finish', cb);
};
exports.default = imageTask;File Name
myfilename[w200,h200].jpg
The above will crop your picture to 200x200
and output:
myfilename.jpg
### Options If you wish for examples take a look in test/
- w = width
 - h = height
 - r = aspect ratio