【问题标题】:Is there a way to identify and remove thumbnail from tiff image?有没有办法从 tiff 图像中识别和删除缩略图?
【发布时间】:2021-12-17 19:53:06
【问题描述】:

我们有一个使用 Adob​​e Illustrator 裁剪 pdf 图像的过程。在此过程中,缩略图元数据被添加到图像中。稍后我们将图像转换为 eps。到那时为止,图像看起来还不错。然后我们使用 ImageMagick 将图像转换为 tiff。在此阶段,缩略图将附加到原始图像的左上角。有没有办法删除这个缩略图?

【问题讨论】:

  • 听起来很奇怪。你能分享一个你的 tiff(可能是 eps)图像的例子吗?
  • 对不起,不会分享图片,因为它可能违反公司政策

标签: imagemagick thumbnails tiff adobe-illustrator


【解决方案1】:

有多种可能性,具体取决于实际发生的情况,如果不查看每个阶段的输入和输出文件以及实际处理,很难判断。


有时缩略图是 TIFF 中的第一个条目,因此您可以选择仅从 TIFF 中的第二个条目(从零开始计数)开始加载:

magick input.tif[1--1] ...

如果您无法避免加载第一个/最后一个条目,您可以加载所有内容,然后删除您不想要的任何内容。所以,如果我检查这样的图像,我会看到它有 6 个场景,即。 0 到 5:

magick identify image.tif
image.tif[0] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 283124B 0.000u 0:00.000
image.tif[1] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[2] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[3] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[4] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[5] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000

如果我想删除第一个和最后一个条目,在处理剩余条目之前,我可以这样做:

magick image.tif -delete 0,-1  -format "Processing scene: %s Resolution: %G\n" -write info: <FURTHER PROCESSING OF EACH PAGE> result-%d.png

样本输出

magick image.tif -delete 0,-1  -format "Processing scene: %s Resolution: %G\n" -write info: -crop 10x10+0+0 result-%d.png
Processing scene: 1 Resolution: 2448x3168
Processing scene: 2 Resolution: 2448x3168
Processing scene: 3 Resolution: 2448x3168
Processing scene: 4 Resolution: 2448x3168

您可以通过检查您的图像来确定是否是这种情况:

  • exiftool YOURIMAGE 并寻找“子文件类型:多页图像的单页”
  • tiffinfo YOURIMAGE 并查找条目数
  • magick identify YOUIRIMAGE 并寻找不止一行的输出

有时缩略图包含在元数据中,因此您可以尝试使用以下方法之一去除这些缩略图:

magick INPUT.JPG -strip RESULT.JPG
jhead -dt YOURIMAGE
exiftool -thumbnailimage= YOURIMAGE

您还可以通过以下方式找到这些:

  • exiftool YOURIMAGE 并寻找嵌入的二进制数据
  • magick identify -verbose YOURIMAGE
  • jhead YOURIMAGE

【讨论】:

    【解决方案2】:

    您可以尝试以下解决方案:

    exiftool -ifd1:all= -m Your_file_name
    

    这才是真正帮助我们的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-09
      • 2019-02-17
      • 1970-01-01
      • 2020-11-13
      • 2018-05-27
      • 2022-11-12
      • 1970-01-01
      • 2020-02-27
      相关资源
      最近更新 更多