Last active
May 17, 2016 17:10
-
-
Save laurentlemaire/1209d519c132f10062fe to your computer and use it in GitHub Desktop.
Gulp setup - 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var imageResize = require('gulp-image-resize'); | |
var rename = require('gulp-rename'); | |
gulp.task('img-thumb', function () { | |
return gulp.src('web/galleries/uploads/*/*.jpg') | |
.pipe(imageResize({ | |
width : 365, | |
height : 300, | |
crop : true, | |
upscale : false | |
})) | |
.pipe(gulp.dest('web/galleries/dist/thumb')); | |
}); | |
gulp.task('img-large', function () { | |
return gulp.src('web/galleries/uploads/*/*.jpg') | |
.pipe(imageResize({ | |
width : 1800, | |
height : 1000, | |
crop : false, | |
upscale : false, | |
sharpen: true | |
})) | |
.pipe(gulp.dest('web/galleries/dist/large')); | |
}); | |
// Called from app | |
gulp.task('process-img-thumb', function () { | |
return gulp.src('web/galleries/process/*/*.jpg') | |
.pipe(imageResize({ | |
width : 365, | |
height : 300, | |
crop : true, | |
upscale : false | |
})) | |
.pipe(gulp.dest('web/galleries/dist/thumb')); | |
}); | |
gulp.task('process-img-large', function () { | |
return gulp.src('web/galleries/process/*/*.jpg') | |
.pipe(imageResize({ | |
width : 1800, | |
height : 1000, | |
crop : false, | |
upscale : false, | |
sharpen: true | |
})) | |
.pipe(gulp.dest('web/galleries/dist/large')); | |
}); | |
gulp.task('default', [], function() { | |
gulp.start('img-large', 'img-thumb'); | |
}); | |
gulp.task('process-img', [], function() { | |
gulp.start('process-img-large', 'process-img-thumb'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment