I get an error as follows when calling resize:images
task in my gulpfile (see bottom) ...
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error: write EOF
at finish (C:\Users\brendan\Documents\Code\Web\TheOrm\WWW\v3\node_modules\gulp-gm\index.js:40:21)
at gm.<anonymous> (C:\Users\brendan\Documents\Code\Web\TheOrm\WWW\v3\node_modules\async\lib\async.js:485:30)
at emitMany (events.js:127:13)
at gm.emit (events.js:201:7)
at gm.<anonymous> (C:\Users\brendan\Documents\Code\Web\TheOrm\WWW\v3\node_modules\gm\lib\getters.js:70:16)
at Socket.cb (C:\Users\brendan\Documents\Code\Web\TheOrm\WWW\v3\node_modules\gm\lib\command.js:322:16)
at Socket.g (events.js:291:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at onwriteError (_stream_writable.js:340:10)
Imagemagick is installed and seems to work from the command line. i.e. magick -help
gives sensible output and you can save the inbuilt test logo image.
I have tried various other gulp libraries including gulp-responsive-images
which gives an empty pipe error.
I tried this under the Linux Subsystem for Windows and it works fine - it seems that this is a Windows only problem.
After forking gulp-image-resize
and running the test suite I get the following error ...
...
[14:18:20] Starting 'image_resize:interlace_and_resize_imagemagick'...
events.js:160
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:1026:11)
at Socket._writeGeneric (net.js:710:26)
at Socket._write (net.js:729:8)
at doWrite (_stream_writable.js:328:12)
at writeOrBuffer (_stream_writable.js:314:5)
at Socket.Writable.write (_stream_writable.js:241:11)
at Socket.write (net.js:656:40)
at gm._spawn (C:\Users\brendan\Documents\Code\OpenSource\gulp-image-resize\node_modules\gm\lib\command.js:194:18)
at gm._exec (C:\Users\brendan\Documents\Code\OpenSource\gulp-image-resize\node_modules\gm\lib\command.js:167:17)
at gm.proto.(anonymous function) [as size] (C:\Users\brendan\Documents\Code\OpenSource\gulp-image-resize\node_modules\gm\lib\getters.js:68:12)
Unfortunately, the repo had bug reporting disabled - does anyone know how this might be remedied?
Here is my gulpfile.js ...
let gulp = require('gulp');
let imageResize = require('gulp-image-resize');
let path = require('path');
let rename = require('gulp-rename');
let debug = require('gulp-debug');
let INPUT_DIR = './NO_UPLOAD/img_src';
let OUTPUT_DIR = './NO_UPLOAD/img_tmp';
gulp.task('resize:images', function() {
relFns = [
'logo.png',
'image.png',
].map((f) => path.join(INPUT_DIR, f));
return gulp.src(relFns, { base: INPUT_DIR })
.pipe(debug({ title: 'resized' }))
.pipe(imageResize({
width: 100
}))
.pipe(rename((path) => { path.basename += '.sml' }))
.pipe(gulp.dest(OUTPUT_DIR));
});
There were a number of issues ...
gm
and magick
are in your pathIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With