我有一个带有一组特定标签的 TIFF 文件。当我转换此文件以修复 ICC 元数据的偏移量(未字对齐)时,我得到了一组完全不同的标签。为什么会发生这种情况以及如何保留原始元数据?
转换:
convert original.tif fixed.tiff
缺少标签:
- 软件 (305)
- 日期时间 (306)
- 艺术家 (315)
新标签:
- 白点 (318)
- 主要色度 (319)
tiffdump 的完整输出:
$ tiffdump original.tif
original.tif:
Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF>
Directory 0: offset 8 (0x8) next 0 (0)
SubFileType (254) LONG (4) 1<2>
ImageWidth (256) LONG (4) 1<2370>
ImageLength (257) LONG (4) 1<3334>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<2>
FillOrder (266) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 1<125459>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<3>
RowsPerStrip (278) SHORT (3) 1<3334>
StripByteCounts (279) LONG (4) 1<23704740>
XResolution (282) RATIONAL (5) 1<400>
YResolution (283) RATIONAL (5) 1<400>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
PageNumber (297) SHORT (3) 2<0 1>
Software (305) ASCII (2) 30<Some software...>
DateTime (306) ASCII (2) 20<2009:07:01 10:46:50\0>
Artist (315) ASCII (2) 37<Some creator...>
ICC Profile (34675) UNDEFINED (7) 125084<00 0x1 0xe8 0x9c 0x41 0x50 0x50 0x4c 0x2 0x40 00 00 0x73 0x63 0x6e 0x72 0x52 0x47 0x42 0x20 0x4c 0x61 0x62 0x20 ...>
$ tiffdump fixed.tiff
fixed.tiff:
Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF>
Directory 0: offset 23704748 (0x169b4ac) next 0 (0)
ImageWidth (256) SHORT (3) 1<2370>
ImageLength (257) SHORT (3) 1<3334>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<2>
FillOrder (266) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 3334<8 7118 14228 21338 28448 35558 42668 49778 56888 63998 71108 78218 85328 92438 99548 106658 113768 120878 127988 135098 142208 149318 156428 163538 ...>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<3>
RowsPerStrip (278) SHORT (3) 1<1>
StripByteCounts (279) LONG (4) 3334<7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 7110 ...>
XResolution (282) RATIONAL (5) 1<400>
YResolution (283) RATIONAL (5) 1<400>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
PageNumber (297) SHORT (3) 2<0 1>
Whitepoint (318) RATIONAL (5) 2<0.3127 0.329>
PrimaryChromaticities (319) RATIONAL (5) 6<0.64 0.33 0.3 0.6 0.15 0.06>
ICC Profile (34675) UNDEFINED (7) 125084<00 0x1 0xe8 0x9c 0x41 0x50 0x50 0x4c 0x2 0x40 00 00 0x73 0x63 0x6e 0x72 0x52 0x47 0x42 0x20 0x4c 0x61 0x62 0x20 ...>
我正在 Cygwin 下使用最近安装的 Imagemagick 和 libtiff。