Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: buffer is not defined #10

Closed
mvasin opened this issue Nov 13, 2015 · 5 comments
Closed

ReferenceError: buffer is not defined #10

mvasin opened this issue Nov 13, 2015 · 5 comments

Comments

@mvasin
Copy link

mvasin commented Nov 13, 2015

I get this error

/Users/username/Sites/process images/node_modules/imagemin-jpegtran/index.js:61
            if (err && (err.code !== 'EPIPE' || !isJpg(buffer))) {
                                                       ^

ReferenceError: buffer is not defined
    at ChildProcess.<anonymous> (/Users/mvasin/Sites/process images/node_modules/imagemin-jpegtran/index.js:61:47)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

every time I run this script

gulp.task('imagemin', () => {
    return gulp.src('src/**/*')
        .pipe(plumber({
            errorHandler: function (err) {
                gutil.beep();
                console.log(err);
               // this.emit('end');
            }
        }))
        .pipe(changed('dest'))
        .pipe(remember('all'))
        .pipe(imagemin({
            optimizationLevel: 2,
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngquant()]
        }))
        .pipe(gulp.dest('dest'))
        .pipe(cache('cache1', {optimizeMemory: true}))
        .pipe(remember('all'))
        .pipe(cache('cache1', {optimizeMemory: true}))
        .pipe(gulp.dest('dest'));
});

while working on 1,35GB directory of files.

@shinnn
Copy link
Contributor

shinnn commented Nov 13, 2015

Fixed in 79e8f08

@shinnn shinnn closed this as completed Nov 13, 2015
@mvasin
Copy link
Author

mvasin commented Nov 13, 2015

When the updated version will make it's way to NPM? Current v.3.3.4 doesn't include this update.

@shinnn
Copy link
Contributor

shinnn commented Nov 13, 2015

Released as v4.3.2. 0e6a658

@mvasin
Copy link
Author

mvasin commented Nov 13, 2015

I type npm update imagemin-jpegtran, then npm -v imagemin-jpegtran and see 3.3.4. What do I do wrong?

@shinnn
Copy link
Contributor

shinnn commented Nov 14, 2015

👉 https://stackoverflow.com/

That's not an issue with imagemin-jpegtran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants