我有几个从 Adobe Illustrator 导出的 EPS 文件数据,它显然嵌入了 TIFF 预览,以便可以预览 EPS 文件。
这是不希望的,因为我在 XeLaTeX 中使用这些文件,它抱怨
Invalid UTF-8 byte or sequence at line 198 replaced by U+FFFD
这是由 TIFF 预览中的二进制数据引起的。我想安全地删除此预览。我无法访问 Adobe Illustrator。我想使用 Unix/Linux 上可用的工具。
exiftool
输出
ExifTool Version Number : 10.15
File Name : ce_mark_with_cert_number.eps
Directory : .
File Size : 492 kB
File Modification Date/Time : 2016:05:13 15:24:17+02:00
File Access Date/Time : 2016:05:13 15:24:17+02:00
File Inode Change Date/Time : 2016:05:13 15:24:17+02:00
File Permissions : rw-r--r--
File Type : EPS
File Type Extension : eps
MIME Type : application/postscript
TIFF Preview : (Binary data 123976 bytes, use -b option to extract)
Exif Byte Order : Little-endian (Intel, II)
Subfile Type : Full-resolution Image
Bits Per Sample : 8
Compression : Uncompressed
Photometric Interpretation : RGB Palette
Samples Per Pixel : 2
Planar Configuration : Chunky
Strip Offsets : 379936
Strip Byte Counts : 115542
Color Map : (Binary data 1536 bytes, use -b option to extract)
Extra Samples : Associated Alpha
Clipping Path Name : Path
Creator : Adobe Illustrator(R) 8.0
For : Some cool company GmbH
Title : ce_mark_with_cert_number.eps
Create Date : 4/18/2007 10:49 AM
Bounding Box : 100 376 542 508
Version : 1.2 0
Copyright : (C) 1987-1996 Adobe Systems Incorporated All Rights Reserved
Image Height : 132
Image Width : 442
Image Size : 442x132
Megapixels : 0.058
重要的一行是:
TIFF Preview : (Binary data 123976 bytes, use -b option to extract)
我想安全地将其从文件中删除,同时保留其他元数据。
使用 imagemagick Nuke 元数据
imagemagick 中的参数-strip
有效,但它会删除所有元数据。这并不理想。
find -iname '*.eps' -print0 | xargs -0 -I file convert -strip file file
精确尝试exiftool
尝试1
exiftool -TIFFPreview:all= ce_mark_with_cert_number.eps
产量
Warning: Sorry, Not a deletable group: TIFFPreview
Nothing to do.
尝试2
exiftool -ThumbnailImage= -PreviewImage= ce_mark_with_cert_number.eps
Warning: [minor] Entries in IFD0 were out of sequence. Fixed. - ce_mark_with_cert_number.eps
产量
Warning: [minor] Entries in IFD0 were out of sequence. Fixed. - ce_mark_with_cert_number.eps
0 image files updated
1 image files unchanged