question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Processs newer images only

See original GitHub issue

It would be very helpful to have an option to only process files that do not exist in dest, or that are newer than those in dest.

I tried piping through gulp-newer but got the following error: Expected a source file with stats

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mahnunchikcommented, Nov 5, 2015

Hi @TxHawks @mvasin

gulp-cached works like a charm! It supports the necessary 1:many relations between files.

gulp-changed supports only 1:1 gulp-newer supports 1:1 and many:1

But you have to set errorOnUnusedConfig option to false because there will be unused configurations for not updated files.

My test case:

'use strict';

var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
// gulp-responsive
// gulp-cached
// gulp-debug

gulp.task('default', ['images'], function() {
  gulp.watch('src/*.jpg', ['images']);
});

gulp.task('images', function() {
  return gulp.src('src/*.jpg')
    .pipe($.debug({title: 'sources:'}))
    .pipe($.cached('images'))
    .pipe($.debug({title: 'before gulp-responsive:'}))
    .pipe($.responsive({
      'image.jpg': [{
        width: 200,
        rename: 'img-200.jpg'
      }, {
        width: 400,
        rename: 'img-400.jpg'
      }, {
        width: 600,
        rename: 'img-600.jpg'
      }]
    }, {
      errorOnUnusedConfig: false
    }))
    .pipe($.debug({title: 'after gulp-responsive:'}))
    .pipe(gulp.dest('dist'));
});
0reactions
mahnunchikcommented, Jan 9, 2016

Landed version 2.0 of gulp-responsive

Feedback welcome 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Process Multiple Photos Fast with Adobe Bridge
https://shutr.bz/3LjwaSZ - Batch edit and export multiple photos fast with these simple tricks for Adobe Bridge.
Read more >
java - Processing - How to tint only one image? - Stack Overflow
You can call noTint() after drawing the image to revert to normal image mode before trying to draw any other images.
Read more >
Don't Fear Photo Post-Processing - Shooting is Only the First ...
Post-processing is just part of image creation and is nothing you need to fear. See some examples of how in-camera is just the...
Read more >
Check the status of your library in Photos for macOS
If you see "Items on This Mac Only" · From the menu bar in Photos, choose File > New Smart Album. · Name...
Read more >
docker pull - Docker Documentation
In some cases you don't want images to be updated to newer versions, but prefer to use a fixed version of an image....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found