cwebp -metadata all 不保留元数据

huangapple go评论47阅读模式
英文:

cwebp -metadata all does not keep metadata

问题

我正在尝试使用cwebp将JPG图像转换并压缩为webp格式。默认情况下,-metadata标签设置为none。这会导致一些图像旋转到错误的角度,因为旋转的元数据丢失了。

当尝试使用-metadata all时,我收到错误消息:“警告:此平台目前仅支持提取ICC配置文件”,这导致图像被转换和压缩,但没有任何元数据。我使用的完整命令是:cwebp -metadata all image.JPG -o image.webp

错误似乎表明cwebp不支持保留元数据,但我很难相信。我是否做错了什么,还是应该考虑使用其他工具?

英文:

I am trying to use cwebp to convert and compress JPG images to webp. By default the -metadata tag is set to none. This results in some images being rotated into the wrong angle as the metadata for rotation gets lost.

When trying to use -metadata all i get the error: "Warning: only ICC profile extraction is currently supported on this platform" which results in the image being converted and compressed but none of the metadata coming along. The full command i use is: cwebp -metadata all image.JPG -o image.webp

The error makes it seem like cwebp doesn't support keeping metadata at all but i find that hard to believe. Am i doing anything wrong or should i be looking into another tool?

答案1

得分: 0

在查看了一些内容后,我找到了一个可行的解决方案。使用 cwepb 将图像转换为 .webp 后,您可以使用 ExifTool 将元数据从原始的 JPG 文件复制到 .webp 文件中,如下所示:exiftool -TagsFromFile image.JPG image.webp。然后,您可以使用 ImageMagick 来应用旋转,命令如下:magick image.webp -auto-orient ouputImage.webp

英文:

After looking around a bit i found a functional solution for this. After converting the image to .webp with cwepb you can use ExifTool to copy the metadata from the original JPG file as such: exiftool -TagsFromFile image.JPG image.webp. You can then use ImageMagick to apply the rotation with magick image.webp -auto-orient ouputImage.webp.

huangapple
  • 本文由 发表于 2023年7月14日 01:34:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76681968.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定