logo
down
shadow

gulp-imagemin - how to disregard directory structures?


gulp-imagemin - how to disregard directory structures?

By : Chris
Date : November 22 2020, 10:33 AM
will be helpful for those in need I was able to achieve this with gulp-flatten by adding .pipe(flatten()) after the .imagemin()
code :


Share : facebook icon twitter icon
Use gulp imagemin optimizers in combination with gulp-load-plugins

Use gulp imagemin optimizers in combination with gulp-load-plugins


By : Ritu
Date : March 29 2020, 07:55 AM
To fix this issue I think that you should install imagemin-svgo plugin to get this work, because it is not included by default to gulp-imagemin like precised at the bottom line of the README.
Install it using npm:
code :
npm install --save imagemin-svgo
Use Gulp-imagemin with imagemin-jpeg-recompress plugin?

Use Gulp-imagemin with imagemin-jpeg-recompress plugin?


By : user3830141
Date : March 29 2020, 07:55 AM
hop of those help? I'm going to answer my own question. I could be wrong but it seems it's an easy process. Simply require the plugin (in this case, I want to use imagemin-jpeg-recompress plugin). Then specify the plugin to use within imagemin via the use property of imagemin. I believe this will override the bundled jpegtran optimizer that comes with imagemin.
code :
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
var imageminJpegRecompress = require('imagemin-jpeg-recompress');

gulp.task('optimize', function () {
  return gulp.src('src/images/*')
    .pipe(imagemin({
      use:[imageminJpegRecompress({
        loops:4,
        min: 50,
        max: 95,
        quality:'high' 
      })]
    }))
});
Gulp-imagemin error?

Gulp-imagemin error?


By : J. Freeman
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further First time I am using gulp.In my gulpfile.js contains
code :
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
gulp.task('default', function () { console.log('Hello Gulp!') });
gulp.task('imagemin', function() {
   var img_src = 'src/images/**/*', img_dest = 'build/images';

   gulp.src(img_src)
   .pipe(imagemin())
   .pipe(gulp.dest(img_dest));
});
Gulp image optimizer(gulp-imagemin) not fully optimize

Gulp image optimizer(gulp-imagemin) not fully optimize


By : Silver Zhang
Date : March 29 2020, 07:55 AM
will help you I am using gulp to compile my work, Recently I am using gulp-imagemin plugin to optimize the images, and its working but still not fully optimize.On Google PageSpeed Insights showing the images are not fully optimize.How to fully optimize my images? Please help. This is the function I am using on my gulpfile.js, And it reducing about 2-5% images size.But not fully optimize. , This one working much better..
code :
gulp.task('imgs', function () {
    gulp
        .src(paths.assets.images)
        .pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })))
        .pipe(flatten())
        .pipe(gulp.dest(paths.build + "/images"));
});
Can I use gulp-imagemin with gulp-watch?

Can I use gulp-imagemin with gulp-watch?


By : D Miley
Date : March 29 2020, 07:55 AM
Hope that helps in your watch task, you're watching image changes in 'dist/images/'.. you should change that to **'src/images/*'
Also in your image task, you're watching only for images directly in the images folder (non recursive). I'd recomment to listen to 'src/images/'**
Related Posts Related Posts :
  • How to change add and remove active class in JavaScript
  • how to toggle a specific div in javascript
  • How to get all the values from multiple keys of an array of object?
  • jQuery bind() unbind() and on() and off()
  • regular expression to find DD Month YYYY from a string
  • How to upload files from web client (HTML/jQuery form) to your Dropbox folder
  • Backbone history and require.js issue
  • Confusion over Classical and Prototypal Inheritance Javascript
  • How to take screen shot of current webpage using Javascript/JQuery?
  • Store meridiem in a variable
  • class declared inside closure vs standard class without closure
  • javascript confirm box always return true
  • dynamically changing the size of font size based on text length using css and html
  • Node.js - Getting the host IP address while on Amazon EC2
  • Confusing CSS, can anyone explain please
  • How to install v8-profiler on Windows 8 (64 bit) using npm?
  • Resolve promise based on another promise
  • google maps adding overlay layer above UI and markers
  • Style specific letter?
  • RangeError: Maximum call stack size exceeded with array.slice
  • node rest client get with local variable
  • If condition not executes while mouse move fastly
  • Count the number of displayed elements in a HTML list
  • Locate JavaScript source code in Emacs
  • Clean, Modular Code vs MV* Frameworks
  • infinite scroll without loading image
  • Backbone: reverse collection order with comparator
  • What do printers ignore?
  • jQuery UI .tabs() Contentless tab?
  • Execute Javascript alert() after page (visually) loaded
  • JavaScript - duplicating array doesn't work
  • Excessive clickable area below image
  • JavaScript Regex: Replace |b| with <b>
  • Unexpected value change in 2D array in JavaScript
  • Function doesnt see parameter as a array of objects
  • jQuery fetch keypress event on chrome and IE
  • How to enable jquery validate localization?
  • Cassandra map collection returned by node.js Helenus looks odd
  • angular ng-repeat with multiple filter options
  • Selecting Children without ID or Class names
  • How to uncheck a group of checkboxes when another checkbox is checked
  • Is hiding content by Javascript or jQuery Worth trying
  • Load XUL resource using javascript
  • XML to HTML text area from server file system
  • set focus() on textbox on form onload
  • es lint '' is assigned a value but never used' eventhough i have used it
  • Can "name" attribute be used for custom VueJS components
  • Get innerHTML of content when it is clicked
  • HTTPS causes CSS animations to not load? Very confused
  • How to hide other div apart from touched div to the band
  • Is global variable assignment atomic on NodeJS?
  • Datepicker onchangemonthyear beforeshowday
  • trying to render html files using jade but it still adresses it as a jade
  • Google Analytics - Understanding and Dissecting the Snippet: What is | | [ ];
  • Replacing "[aA09.b]." to "[aA09.b]\n" in in JavaScript
  • Why wrap a function definition in an immediate function?
  • Enable / disable jQuery script on switching to different tab in a HTML page
  • how can find return variable value outside anonymous function in node js mysql query function
  • Converting 1 to 0001 in javascript array
  • svg viewbox should not resize the text fontSize?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org