How to use the gulp-imagemin.jpegtran function in gulp-imagemin

To help you get started, we’ve selected a few gulp-imagemin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jbrodriguez / hugulp / gulp / build.js View on Github external
gulp.task('images', function() {
  return gulp
    .src(path.join(config.build.source, config.path.images, '**', '*.*')) // i.e.: public/images/**/*.*
    .pipe(
      imagemin([
        imagemin.gifsicle(config.gifsicle),
        imagemin.jpegtran(config.jpegtran),
        imagemin.optipng(config.optipng),
        imagemin.svgo(config.svgo)
      ])
    )
    .pipe(gulp.dest(path.join(config.build.target, config.path.images))) // i.e.: public/images
})
github grrr-amsterdam / gulpfile / tasks / images.js View on Github external
export const images = done => {
  if (!config.get('tasks.images')) {
    log(`Skipping 'images' task`);
    return done();
  }
  return pump([
    src(config.get('tasks.images.src')),
    imagemin([
      imagemin.jpegtran({
        progressive: true,
      }),
      imagemin.svgo({
        plugins: [
          { removeViewBox: false },
        ],
      }),
    ]),
    dest(config.get('tasks.images.dist')),
  ], done);
};
github jeshan / lambda-checklist / gulpfile.babel.js View on Github external
gulp.task('compress-images', ['compress-webp'], () => {
  return gulp.src(dirs.src + '/img/**/*.{jpg,png,svg}')
    .pipe(imagemin([
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
    ]))
    .pipe(gulp.dest(dirs.dest + '/img/'));
});
github atolye15 / web-starter-kit / gulp / tasks / images / optimize.js View on Github external
return function() {
    return gulp
      .src([`${configs.paths.src}/img/**/*`, `!${configs.paths.src}/img/{icons,icons/**}`])
      .pipe(plumber({ errorHandler: notify.onError('Hata: <%= error.message %>') }))
      .pipe(newer('.tmp/img'))
      .pipe(
        imagemin([
          imagemin.gifsicle({ interlaced: true }),
          imagemin.jpegtran({ progressive: true }),
          imagemin.optipng({ optimizationLevel: 5 }),
          imagemin.svgo({ plugins: [{ removeDimensions: true }] }),
        ]),
      )
      .pipe(gulp.dest('.tmp/img'));
  };
}
github colinrotherham / core / src / tasks / img / optimise.js View on Github external
export default (config, gulp) => {

  const options = config.options || [
    imagemin.gifsicle(),
    imagemin.jpegtran({
      progressive: true,
    }),
    imagemin.optipng(),
    imagemin.svgo({
      plugins: [{
        removeViewBox: false,
      }],
    }),
  ];

  return () => gulp.src(config.src, { dot: true })
    .pipe(imagemin(options))
    .pipe(gulp.dest(config.dest));
};
github acauamontiel / mantis-starter / gulpfile.babel.js / tasks / img.js View on Github external
export default function imgTask (done) {
	src(img.src)
		.pipe(newer(img.dest))
		.pipe(imagemin([
			imagemin.jpegtran({progressive: true}),
			imagemin.gifsicle({interlaced: true}),
			imagemin.svgo({
				multipass: true,
				plugins: [
					{removeUselessDefs: false},
					{removeHiddenElems: false},
					{removeViewBox: false},
					{cleanupIDs: false}
				]
			})

		]))
		.pipe(dest(img.dest))
		.on('end', reload);

	done();
github escueladigital / EDboilerplate / gulpfile.babel.js View on Github external
gulp.task('images-build', () => {
  gulp.src('./src/img/**/**')
    .pipe(imagemin([
      imagemin.gifsicle({interlaced: true}),
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
      imagemin.svgo()
    ]))
    .pipe(gulp.dest('./public/assets/img'))
})
github codingphasedotcom / hyperapp-starterkit / gulpfile.js View on Github external
gulp.series(function minizingImages() {
		return gulp
			.src('assets/img/**/*')
			.pipe(
				imagemin([
					imagemin.gifsicle({ interlaced: true }),
					imagemin.jpegtran({ progressive: true }),
					imagemin.optipng({ optimizationLevel: 5 }),
					imagemin.svgo({
						plugins: [{ removeViewBox: true }, { cleanupIDs: false }]
					})
				])
			)
			.pipe(gulp.dest('./public/img'));
	})
);
github jeshan / cloudformation-checklist / gulpfile.babel.js View on Github external
gulp.task('compress-images', ['compress-webp'], () => {
  return gulp.src(dirs.src + '/img/**/*.{jpg,png,svg}')
    .pipe(imagemin([
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
    ]))
    .pipe(gulp.dest(dirs.dest + '/img/'));
});

gulp-imagemin

Minify PNG, JPEG, GIF and SVG images

MIT
Latest version published 8 months ago

Package Health Score

69 / 100
Full package analysis