gulpjs / gulp

A toolkit to automate & enhance your workflow

Home Page:https://gulpjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gulp 5 corrupt images

deco1974 opened this issue · comments

I want to copy images to the dist folder:

src(
    [
        './src/img/*.*',
    ]
).pipe(dest('./dist/img'));

The images get corrupted in Gulp 5. Downgrade to Gulp 4.0.0.2 everything is working fine as expected.
Is there something i miss in the new version?

Check out #2766 :)

Looks like using {encoding: false} will solve the issue, but {read: false} will work just to copy files. In my case I'm converting the images to webp, so {read:false} doesn't work.

@aloayzab88 if you are modifying the contents, you need to read the file so you'll turn encoding off