Skipping files which give "Premature end of JPEG file"
See original GitHub issueWhen using gulp-imagemin to minimize thousands of files (16,000).
In this directory there are about a 1000 damaged files that give “Premature end of JPEG file” error.
Is there a way to skip optimization for these files without crashing the task?
Does anyone have a solution ?
LOG:
events.js:160
throw er; // Unhandled 'error' event
^
Error: Premature end of JPEG file
at Promise.all.then.arr (D:\php_workspace\photo_shrink\2f076e49f92998893f1b4004ebf9de6e\node_modules\execa\index.js:202:11)
CODE: gulp.task(‘default’, function(){ return gulp.src([from + ‘//*.png’,from + '//.jpg’,from + '/**/.jpeg’,from + ‘/**/*.gif’]) .pipe(filelog()) .pipe(imagemin()) .pipe(gulp.dest(to)); });
gulp.start(‘default’);
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Premature end of JPEG file - Stack Overflow
Interesting and strange part is that i am getting this error only when i upload any camera taken images, like from mobile, other...
Read more >Premature end of JPEG file - Agisoft Metashape
I'm getting the error "premature end of jpeg file" while merging five chunks with an average of about 1000 images in them.
Read more >Premature end of JPEG file - Processing Forum
I am trying to load JPEG files into processing while they are constantly being written onto my machine form an external camera.
Read more >[GM-help] premature end of JPEG/Unsupported marker type
Hello. I ran into a couple weird errors today. I have two jpeg files which were created in different ways but are both...
Read more >Corrupted DICOM JPEG file - Google Groups
second entry dcmdump: error: I/O suspension or premature end of stream: reading file: C:\temp\GENESIS_SIGNA-JPEG-CorruptFrag.dcm. Ross's profile photo ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can do this in /node-modules/gulp-imagemin/index.js
Hope it helps.