在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):dcgauld/gulp-responsive-images开源软件地址(OpenSource Url):https://github.com/dcgauld/gulp-responsive-images开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-responsive-imagesA simple Gulp plugin that allows the resizing and renaming of images, primarily for responsive applications. It uses GraphicsMagick to allow simple resizing, cropping, quality control and more. InstallInstall with npm.
GraphicsMagickgulp-responsive-images requires GraphicsMagick to function. Installation is simple: Ubuntu:apt-get install graphicsmagick Homebrew):Mac OS X (usingbrew install graphicsmagick Windows (XP, Vista, 7, 8, and 10) 32- or 64-bit:Decide upon Q8 or Q16:
Download and Install, be sure that "Update executable search path" is checked during installation. Options// Image.js
var images = {
'hero.png': [
{
crop: false,
format: null,
gravity: 'Center',
height: 100,
overwrite: true,
quality: 100,
rename: null,
percentage: false,
sharpen: false,
suffix: '-100'
upscale: false,
width: 100
}
]
};
module.exports = images;
}); Can also be used within the pipe to overwrite specific file configurations. Examplevar gulp = require('gulp');
var responsive = require('gulp-responsive-images');
gulp.task('default', function () {
gulp.src('source/images/**/*')
.pipe(responsive({
'hero.png': [{
width: 100,
suffix: '-100'
}, {
width: 100 * 2,
suffix: '-100-2x'
}],
'*.png': [{
width: 600,
crop: true,
gravity: 'Center'
}]
}))
.pipe(gulp.dest('dist/images'));
}); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论