简体   繁体   English

Gulp-imagemin:如何保存EXIF?

[英]Gulp-imagemin: how to preserve EXIF?

Is there a way to preserve metadata such as EXIF? 有没有办法保留EXIF等元数据? I have been unable to find an option for this. 我无法为此找到一个选项。

The different imagemin plugins have different settings. 不同的imagemin插件具有不同的设置。

jpegoptim: jpegoptim:

gulp.task('compressjpegoptim', () => {
  gulp
  .src('./images/*.jpg')
  .pipe(imagemin([imageminJpegoptim({
    stripAll: false,
    stripExif: false,
  })]))
  .pipe(gulp.dest('./dist'))
});

jpegtran jpegtran

imagemin-jpegtran specifically ask jpegtran to remove the markers, with no options to keep them. imagemin-jpegtran特别要求jpegtran删除标记,没有保留标记的选项。 If you modify this line in the source from 'none' to 'all' it will keep the Exif markers. 如果您将源代码中的这一行从'none''all' ,它将保留Exif标记。 This can be seen in jpegtran's documentation (search for Exif). 可以在jpegtran的文档 (搜索Exif)中看到。

mozjpeg mozjpeg

This plugin seems to keep the Exif by default. 默认情况下,此插件似乎保留Exif。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM