TIFF to JPG, image comment lost

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
msander
Posts: 2
Joined: 2016-08-31T08:49:34-07:00
Authentication code: 1151

TIFF to JPG, image comment lost

Post by msander »

When I add a comment to the image meta data, the conversion produces an error message, and in the destination file, the comment is not present.

The command I'm running is something like this
convert.exe C:\image.tiff -resize 700x380^ c:\image.jpg

...and the warning I get is: "convert.exe: Unknown field with tag 59932 (0xea1c) encountered. 'TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/905

The image I'm trying to convert is here: https://dl.dropboxusercontent.com/u/437 ... K-1066.tif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF to JPG, image comment lost

Post by fmw42 »

These are warnings (not errors) that the TIFF file has some meta tag that IM does not understand. If you want to avoid these messages add -quiet just after convert. Your output image should be created even if you have these messages.
msander
Posts: 2
Joined: 2016-08-31T08:49:34-07:00
Authentication code: 1151

Re: TIFF to JPG, image comment lost

Post by msander »

I'd really like to get the meta data across the conversion because it contains the description of the image. As far as I can see, the meta tag that's not understood is an EXIF XP Comment, see http://regex.info/exif.cgi?dummy=on&img ... K-1066.tif

Cheers
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF to JPG, image comment lost

Post by fmw42 »

I am not a windows user. But that tag is not a standard EXIF comment, but is a windows xp specific comment, as far as I can tell. I do not think IM knows about that comment field. I do not see it in the IM verbose information. Is it there in the following?

Code: Select all

Image: CHK-1066.tif
  Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 3247x2055+0+0
  Resolution: 600x600
  Print size: 5.41167x3.425
  Units: PixelsPerInch
  Type: TrueColor
  Base type: TrueColor
  Endianess: LSB
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Pixels: 6672585
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 95.3064 (0.373751)
      standard deviation: 77.5415 (0.304084)
      kurtosis: -0.879672
      skewness: 0.793131
      entropy: 0.915029
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 93.0994 (0.365096)
      standard deviation: 75.7274 (0.29697)
      kurtosis: -0.889259
      skewness: 0.79519
      entropy: 0.901057
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 85.0995 (0.333724)
      standard deviation: 72.5736 (0.284602)
      kurtosis: -0.814871
      skewness: 0.832888
      entropy: 0.869764
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 91.1685 (0.357523)
      standard deviation: 75.3088 (0.295329)
      kurtosis: -0.827279
      skewness: 0.815793
      entropy: 0.895283
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 3247x2055+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: LZW
  Orientation: TopLeft
  Properties:
    crs:AlreadyApplied: True
    date:create: 2016-08-31T11:37:55-07:00
    date:modify: 2016-08-31T11:37:55-07:00
    dc:format: image/tiff
    exif:ColorSpace: 1
    exif:ExifVersion: 0221
    exif:PixelXDimension: 3247
    exif:PixelYDimension: 2055
    icc:copyright: Copyright (c) 1998 Hewlett-Packard Company
    icc:description: sRGB IEC61966-2.1
    icc:manufacturer: IEC http://www.iec.ch
    icc:model: IEC 61966-2.1 Default RGB colour space - sRGB
    photoshop:ColorMode: 3
    photoshop:ICCProfile: sRGB IEC61966-2.1
    photoshop:LegacyIPTCDigest: CBCE84687083C76A58EBB29CA12CD262
    signature: 58015c1a311b574e82993d657eb30278606738db0599f9e473d05681880e7e31
    tiff:alpha: unspecified
    tiff:endian: lsb
    tiff:ImageLength: 2055
    tiff:ImageWidth: 3247
    tiff:Orientation: 1
    tiff:photometric: RGB
    tiff:PhotometricInterpretation: 2
    tiff:ResolutionUnit: 2
    tiff:rows-per-strip: 1
    tiff:SamplesPerPixel: 3
    tiff:XResolution: 600/1
    tiff:YResolution: 600/1
    xap:CreateDate: 2013-07-20T22:36:53+02:00
    xap:CreatorTool: Adobe Photoshop CS5 Macintosh
    xap:MetadataDate: 2016-04-12T08:45:01+02:00
    xap:ModifyDate: 2013-07-20T22:36:53+02:00
    xapMM:DocumentID: xmp.did:CB9700D3DC216811AB08A82CC74A6A1B
    xapMM:InstanceID: xmp.iid:CB9700D3DC216811AB08A82CC74A6A1B
    xapMM:OriginalDocumentID: xmp.did:CB9700D3DC216811AB08A82CC74A6A1B
  Profiles:
    Profile-8bim: 11492 bytes
    Profile-icc: 3144 bytes
    Profile-iptc: 88 bytes
      unknown[2,0]: 
      Keyword[2,25]: ljunghusen ljungskogen
      Keyword[2,25]: ljungs?ter sjukhem
      Keyword[2,25]: villa hus stuga
    Profile-xmp: 5635 bytes
  Artifacts:
    filename: CHK-1066.tif
    verbose: true
  Tainted: False
  Filesize: 14.99MB
  Number pixels: 6.673M
  Pixels per second: 15.16MB
  User time: 0.380u
  Elapsed time: 0:01.440
  Version: ImageMagick 6.9.5-8 Q16 x86_64 2016-08-29 http://www.imagemagick.org
identify: Unknown field with tag 40092 (0x9c9c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/896.
identify: Unknown field with tag 59932 (0xea1c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/896.
identify: Unknown field with tag 59932 (0xea1c) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/896.
identify: Unknown field with tag 40092 (0x9c9c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/896.
identify: Unknown field with tag 59932 (0xea1c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/896.

This is the EXIFTOOL data that I extracted. Is it here?

Code: Select all

exiftool -s -ee -g1 -u -n -D CHK-1066.tif
---- ExifTool ----
    - ExifToolVersion                 : 8.71
---- System ----
    - FileName                        : CHK-1066.tif
    - Directory                       : .
    - FileSize                        : 14986600
    - FileModifyDate                  : 2016:08:31 11:37:55-07:00
    - FilePermissions                 : 644
---- File ----
    - FileType                        : TIFF
    - MIMEType                        : image/tiff
    - ExifByteOrder                   : II
    - CurrentIPTCDigest               : 4a904d3f18c994c91f013f96d29e5f7a
---- IFD0 ----
  254 SubfileType                     : 0
  256 ImageWidth                      : 3247
  257 ImageHeight                     : 2055
  258 BitsPerSample                   : 8 8 8
  259 Compression                     : 5
  262 PhotometricInterpretation       : 2
  273 StripOffsets                    : (Binary data 16990 bytes, use -b option to extract)
  274 Orientation                     : 1
  277 SamplesPerPixel                 : 3
  278 RowsPerStrip                    : 1
  279 StripByteCounts                 : (Binary data 10274 bytes, use -b option to extract)
  282 XResolution                     : 600
  283 YResolution                     : 600
  284 PlanarConfiguration             : 1
  296 ResolutionUnit                  : 2
  297 PageNumber                      : 0 1
  317 Predictor                       : 2
40092 XPComment                       : Det här är en kommentar. This is a comment.
59932 Padding                         : (Binary data 1972 bytes, use -b option to extract)
---- XMP-x ----
    - XMPToolkit                      : Adobe XMP Core 4.2-c020 1.124078, Tue Sep 11 2007 23:21:40
---- XMP-xmp ----
    - CreatorTool                     : Adobe Photoshop CS5 Macintosh
    - CreateDate                      : 2013:07:20 22:36:53+02:00
    - MetadataDate                    : 2016:04:12 08:45:01+02:00
    - ModifyDate                      : 2013:07:20 22:36:53+02:00
---- XMP-dc ----
    - Format                          : image/tiff
    - Subject                         : ljunghusen ljungskogen, ljungsäter sjukhem, villa hus stuga
---- XMP-xmpMM ----
    - InstanceID                      : xmp.iid:CB9700D3DC216811AB08A82CC74A6A1B
    - DocumentID                      : xmp.did:CB9700D3DC216811AB08A82CC74A6A1B
    - OriginalDocumentID              : xmp.did:CB9700D3DC216811AB08A82CC74A6A1B
    - HistoryAction                   : created
    - HistoryInstanceID               : xmp.iid:CB9700D3DC216811AB08A82CC74A6A1B
    - HistoryWhen                     : 2013:07:20 22:36:53+02:00
    - HistorySoftwareAgent            : Adobe Photoshop CS5 Macintosh
---- XMP-exif ----
    - ExifVersion                     : 0221
    - ExifImageWidth                  : 3247
    - ExifImageHeight                 : 2055
    - ColorSpace                      : 1
---- XMP-tiff ----
    - Orientation                     : 1
    - ImageWidth                      : 3247
    - ImageHeight                     : 2055
    - PhotometricInterpretation       : 2
    - SamplesPerPixel                 : 3
    - XResolution                     : 600
    - YResolution                     : 600
    - ResolutionUnit                  : 2
    - BitsPerSample                   : 8, 8, 8
---- XMP-crs ----
    - AlreadyApplied                  : True
---- XMP-photoshop ----
    - ColorMode                       : 3
    - ICCProfileName                  : sRGB IEC61966-2.1
    - LegacyIPTCDigest                : CBCE84687083C76A58EBB29CA12CD262
---- XMP-lr ----
    - HierarchicalSubject             : Platser|ljunghusen ljungskogen, Andra nyckelord|villa hus stuga, Andra nyckelord|ljungsäter sjukhem
---- IPTC ----
    0 ApplicationRecordVersion        : 2
   25 Keywords                        : ljunghusen ljungskogen, ljungsŠter sjukhem, villa hus stuga
---- Photoshop ----
 1061 IPTCDigest                      : cbce84687083c76a58ebb29ca12cd262
 1082 Photoshop_0x043a                : ...printOutput.PstSbool.InteenumInteClrm.printSixteenBitbool.printerNameTEXT.HP LaserJet P2015 Series
 1083 Photoshop_0x043b                : ...printOutputOptions.CptnboolClbrboolRgsMboolCrnCboolCntCboolLblsboolNgtvboolEmlDboolIntrboolBckgObjc.RGBC.Rd  doub@o?Grn doub@o?Bl  doub@o?BrdTUntF#RltBld UntF#RltRsltUntF#Pxl@??.vectorDatabool.PgPsenumPgPsPgPCLeftUntF#RltTop UntF#RltScl UntF#Prc@Y
    0 XResolution                     : 600
    2 DisplayedUnitsX                 : 1
    4 YResolution                     : 600
    6 DisplayedUnitsY                 : 1
 1062 PrintScale                      : ??
 1037 GlobalAngle                     : 120
 1049 GlobalAltitude                  : 30
 1011 PrintFlags                      : .
10000 PrintFlagsInfo                  : ..
 1013 ColorHalftoningInfo             : /ff.lff../ff.???..2.Z..5.-..
 1016 ColorTransferFuncs              : ??????????????????????.???????????????????????.???????????????????????.???????????????????????.?
 1032 GridGuidesInfo                  : ..@.@
 1054 URL_List                        : 
 1050 Slices                          : ....?.Namnl?st-1...?.....null..boundsObjc.Rct1.Top longLeftlongBtomlong..Rghtlong.?.slicesVlLs.Objc..slice..sliceIDlong.groupIDlong.originenum.ESliceOrigin.autoGeneratedTypeenum.ESliceTypeImg .boundsObjc.Rct1.Top longLeftlongBtomlong..Rghtlong.?.urlTEXT.nullTEXT.MsgeTEXT..altTagTEXT..cellTextIsHTMLbool..cellTextTEXT..horzAlignenum.ESliceHorzAlign.default.vertAlignenum.ESliceVertAlign.default.bgColorTypeenum.ESliceBGColorTypeNone.topOutsetlong.leftOutsetlong.bottomOutsetlong.rightOutsetlong
 1064 PixelAspectRatio                : .??
 1044 IDsBaseValue                    : .
 1036 PhotoshopThumbnail              : (Binary data 9124 bytes, use -b option to extract)
 1057 VersionInfo                     : ...Adobe Photoshop.Adobe Photoshop CS5.
 4000 Photoshop_0x0fa0                : maniIRFR?8BIMAnDs?..null.AFStlongFrInVlLs.Objc.null.FrIDlongb?|?FStsVlLs.Objc.null.FsIDlongAFrmlongFsFrVlLs.longb?|?LCntlong8BIMRoll.
 4001 Photoshop_0x0fa1                : mfri....
---- ExifIFD ----
59932 Padding                         : (Binary data 2060 bytes, use -b option to extract)
---- ICC-header ----
    4 ProfileCMMType                  : Lino
    8 ProfileVersion                  : 528
   12 ProfileClass                    : mntr
   16 ColorSpaceData                  : RGB
   20 ProfileConnectionSpace          : XYZ
   24 ProfileDateTime                 : 1998:02:09 06:49:00
   36 ProfileFileSignature            : acsp
   40 PrimaryPlatform                 : MSFT
   44 CMMFlags                        : 0
   48 DeviceManufacturer              : IEC
   52 DeviceModel                     : sRGB
   56 DeviceAttributes                : 0 0
   64 RenderingIntent                 : 1
   68 ConnectionSpaceIlluminant       : 0.9642 1 0.82491
   80 ProfileCreator                  : HP
   84 ProfileID                       : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
---- ICC_Profile ----
    - ProfileCopyright                : Copyright (c) 1998 Hewlett-Packard Company
    - ProfileDescription              : sRGB IEC61966-2.1
    - MediaWhitePoint                 : 0.95045 1 1.08905
    - MediaBlackPoint                 : 0 0 0
    - RedMatrixColumn                 : 0.43607 0.22249 0.01392
    - GreenMatrixColumn               : 0.38515 0.71687 0.09708
    - BlueMatrixColumn                : 0.14307 0.06061 0.7141
    - DeviceMfgDesc                   : IEC http://www.iec.ch
    - DeviceModelDesc                 : IEC 61966-2.1 Default RGB colour space - sRGB
    - ViewingCondDesc                 : Reference Viewing Condition in IEC61966-2.1
    - Luminance                       : 76.03647 80 87.12462
    - Technology                      : CRT
    - RedTRC                          : (Binary data 2060 bytes, use -b option to extract)
    - GreenTRC                        : (Binary data 2060 bytes, use -b option to extract)
    - BlueTRC                         : (Binary data 2060 bytes, use -b option to extract)
---- ICC-view ----
    8 ViewingCondIlluminant           : 19.6445 20.3718 16.8089
   20 ViewingCondSurround             : 3.92889 4.07439 3.36179
   32 ViewingCondIlluminantType       : 1
---- ICC-meas ----
    8 MeasurementObserver             : 1
   12 MeasurementBacking              : 0 0 0
   24 MeasurementGeometry             : 0
   28 MeasurementFlare                : 0.00999
   32 MeasurementIlluminant           : 2
---- Composite ----
    - ImageSize                       : 3247x2055
If not in either, then one of the IM developers would have to look into this further to see about adding it.
Jason S
Posts: 103
Joined: 2010-12-14T19:42:12-07:00
Authentication code: 8675308

Re: TIFF to JPG, image comment lost

Post by Jason S »

The tag we're talking about is 40092 (XPComment), not 59932 (PADDING_DATA). As far as I can tell, 40092 is not supported by IM. It does appear in the EXIFTOOL output above.

Support for the tags 40091 through 40095 (and maybe some of 18246 through 18249) might be a nice feature, given that they are created by such popular software as Microsoft Windows (the "properties" or "details pane" in Windows Explorer).
Post Reply