PNGs generated with gulp using imageminPngquant + imageminZopfli don't work on MacOS Safari

南楼画角 提交于 2019-12-25 01:49:11

问题


I have the following gulp code for png minification:

function images() {
  return gulp.src([folder.preimages+'/**/*.png'])
    .pipe(cache(imagemin([
      //png
      imageminPngquant({
          speed: 1,
          quality: [0.95, 1] //lossy settings
      }),
      imageminZopfli({
          more: true
          // iterations: 50 // very slow but more effective
      })
    ])))
    .pipe(gulp.dest(folder.public_img));
}

The end result is a very nicely compressed png with a low file size. It works fine on Edge, Chrome, Firefox, but when I try to open it on MacOS Safari it just doesn't open the image.

I found this question, but it involves the libraries directly and I am not sure if I could modify them in my case. In this case I am using what's provided with npm. Is there an alternative I could use for this minification process? I do need it to be lossy.

来源:https://stackoverflow.com/questions/56677452/pngs-generated-with-gulp-using-imageminpngquant-imageminzopfli-dont-work-on-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!