potential bug JPG->TIF losing EXIF data

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

potential bug JPG->TIF losing EXIF data

Post by fmw42 »

Mac OSX Snow Leopard

Code: Select all

Version: ImageMagick 6.9.5-10 Q16 x86_64 2016-09-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib cairo fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib
converting from JPG to TIF is losing the EXIF

JPG:
Image

Code: Select all

identify -verbose DSC_0059.jpg

Code: Select all

 Properties:
    date:create: 2016-09-21T11:51:02-07:00
    date:modify: 2016-02-08T14:36:11-08:00
    exif:CFAPattern: 0, 2, 0, 2, 0, 1, 1, 2
    exif:ColorSpace: 1
    exif:ComponentsConfiguration: 1, 2, 3, 0
    exif:CompressedBitsPerPixel: 4/1
    exif:Contrast: 0
    exif:CustomRendered: 0
    exif:DateTime: 2015:12:05 09:40:52
    exif:DateTimeDigitized: 2015:12:05 09:40:52
    exif:DateTimeOriginal: 2015:12:05 09:40:52
    exif:DigitalZoomRatio: 1/1
    exif:ExifImageLength: 3264
    exif:ExifImageWidth: 4928
    exif:ExifOffset: 228
    exif:ExifVersion: 48, 50, 51, 48
    exif:ExposureBiasValue: 0/6
    exif:ExposureMode: 0
    exif:ExposureProgram: 0
    exif:ExposureTime: 10/600
    exif:FileSource: 3
    exif:Flash: 31
    exif:FlashPixVersion: 48, 49, 48, 48
    exif:FNumber: 28/10
    exif:FocalLength: 170/10
    exif:FocalLengthIn35mmFilm: 25
    exif:GainControl: 1
    exif:GPSInfo: 37868
    exif:GPSVersionID: 2, 3, 0, 0
    exif:InteroperabilityOffset: 37838
    exif:ISOSpeedRatings: 800
    exif:LightSource: 0
    exif:Make: NIKON CORPORATION
    exif:MakerNote: 78, 105, 107, 111, 110, 0, 2, 16, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 55, 0, 1, 0, 7, 0, 0, 0, 4, 48, 50, 49, 48, 0, 2, 0, 3, 0, 0, 0, 2, 0, 0, 3, 32, 0, 4, 0, 2, 0, 0, 0, 8, 0, 0, 2, 162, 0, 5, 0, 2, 0, 0, 0, 13, 0, 0, 2, 170, 0, 7, 0, 2, 0, 0, 0, 7, 0, 0, 2, 186, 0, 8, 0, 2, 0, 0, 0, 13, 0, 0, 2, 194, 0, 9, 0, 2, 0, 0, 0, 20, 0, 0, 2, 210, 0, 11, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 12, 0, 5, 0, 0, 0, 4, 0, 0, 2, 230, 0, 13, 0, 7, 0, 0, 0, 4, 0, 1, 6, 0, 0, 14, 0, 7, 0, 0, 0, 4, 0, 1, 12, 0, 0, 17, 0, 4, 0, 0, 0, 1, 0, 0, 44, 158, 0, 18, 0, 7, 0, 0, 0, 4, 0, 1, 6, 0, 0, 19, 0, 3, 0, 0, 0, 2, 0, 0, 3, 32, 0, 22, 0, 3, 0, 0, 0, 4, 0, 0, 3, 6, 0, 23, 0, 7, 0, 0, 0, 4, 0, 1, 6, 0, 0, 24, 0, 7, 0, 0, 0, 4, 0, 1, 6, 0, 0, 25, 0, 10, 0, 0, 0, 1, 0, 0, 3, 14, 0, 27, 0, 3, 0, 0, 0, 7, 0, 0, 3, 22, 0, 28, 0, 7, 0, 0, 0, 3, 0, 1, 6, 0, 0, 29, 0, 2, 0, 0, 0, 8, 0, 0, 3, 38, 0, 30, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 31, 0, 7, 0, 0, 0, 8, 0, 0, 3, 46, 0, 34, 0, 3, 0, 0, 0, 1, 255, 255, 0, 0, 0, 35, 0, 7, 0, 0, 0, 58, 0, 0, 3, 54, 0, 36, 0, 7, 0, 0, 0, 4, 254, 92, 1, 0, 0, 37, 0, 7, 0, 0, 0, 14, 0, 0, 3, 114, 0, 43, 0, 7, 0, 0, 0, 16, 0, 0, 3, 130, 0, 44, 0, 7, 0, 0, 2, 62, 0, 0, 3, 146, 0, 45, 0, 3, 0, 0, 0, 3, 0, 0, 5, 210, 0, 50, 0, 7, 0, 0, 0, 8, 0, 0, 5, 218, 0, 53, 0, 7, 0, 0, 0, 8, 0, 0, 5, 226, 0, 131, 0, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 132, 0, 5, 0, 0, 0, 4, 0, 0, 5, 234, 0, 135, 0, 1, 0, 0, 0, 1, 9, 0, 0, 0, 0, 137, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 138, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 139, 0, 7, 0, 0, 0, 4, 72, 1, 12, 0, 0, 145, 0, 7, 0, 0, 34, 198, 0, 0, 6, 10, 0, 149, 0, 2, 0, 0, 0, 5, 0, 0, 40, 210, 0, 151, 0, 7, 0, 0, 2, 96, 0, 0, 40, 218, 0, 152, 0, 7, 0, 0, 0, 33, 0, 0, 43, 58, 0, 157, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 158, 0, 3, 0, 0, 0, 10, 0, 0, 43, 94, 0, 162, 0, 4, 0, 0, 0, 1, 0, 126, 138, 20, 0, 163, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 167, 0, 4, 0, 0, 0, 1, 0, 0, 63, 11, 0, 168, 0, 7, 0, 0, 0, 46, 0, 0, 43, 114, 0, 171, 0, 2, 0, 0, 0, 16, 0, 0, 43, 162, 0, 176, 0, 7, 0, 0, 0, 16, 0, 0, 43, 178, 0, 177, 0, 3, 0, 0, 0, 1, 0, 4, 0, 0, 0, 182, 0, 7, 0, 0, 0, 8, 0, 0, 43, 194, 0, 183, 0, 7, 0, 0, 0, 30, 0, 0, 43, 202, 0, 184, 0, 7, 0, 0, 0, 172, 0, 0, 43, 234, 0, 187, 0, 7, 0, 0, 0, 8, 0, 0, 44, 150, 0, 0, 0, 0, 70, 73, 78, 69, 32, 32, 32, 0, 65, 85, 84, 79, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 65, 70, 45, 65, 32, 32, 0, 0, 78, 79, 82, 77, 65, 76, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 66, 117, 105, 108, 116, 45, 105, 110, 44, 84, 84, 76, 45, 66, 76, 32, 32, 32, 32, 0, 0, 0, 1, 168, 0, 0, 1, 0, 0, 0, 1, 186, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 19, 64, 12, 192, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 19, 128, 12, 208, 19, 128, 12, 208, 0, 0, 0, 0, 0, 0, 51, 48, 50, 48, 53, 51, 53, 0, 48, 49, 48, 48, 2, 2, 0, 0, 48, 49, 48, 48, 83, 84, 65, 78, 68, 65, 82, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 84, 65, 78, 68, 65, 82, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 255, 0, 128, 128, 0, 128, 255, 255, 255, 0, 0, 96, 1, 12, 0, 0, 0, 96, 1, 12, 0, 0, 0, 0, 2, 0, 0, 48, 49, 48, 48, 0, 4, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 48, 49, 35, 0, 1, 129, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    exif:MaxApertureValue: 30/10
    exif:MeteringMode: 5
    exif:Model: NIKON D5100
    exif:Orientation: 1
    exif:ResolutionUnit: 2
    exif:Saturation: 0
    exif:SceneCaptureType: 0
    exif:SceneType: 1
    exif:SensingMethod: 2
    exif:Sharpness: 0
    exif:Software: Ver.1.00 
    exif:SubjectDistanceRange: 0
    exif:SubSecTime: 20
    exif:SubSecTimeDigitized: 20
    exif:SubSecTimeOriginal: 20
    exif:thumbnail:Compression: 6
    exif:thumbnail:InteroperabilityIndex: R98
    exif:thumbnail:InteroperabilityVersion: 48, 49, 48, 48
    exif:thumbnail:JPEGInterchangeFormat: 37996
    exif:thumbnail:JPEGInterchangeFormatLength: 8581
    exif:thumbnail:ResolutionUnit: 2
    exif:thumbnail:XResolution: 300/1
    exif:thumbnail:YCbCrPositioning: 2
    exif:thumbnail:YResolution: 300/1
    exif:UserComment: 65, 83, 67, 73, 73, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
    exif:WhiteBalance: 0
    exif:XResolution: 300/1
    exif:YCbCrPositioning: 2
    exif:YResolution: 300/1
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x1,1x1,1x1
    signature: 9344ea039a694c89131031d53abc4655c49c5c4578ec7152a5459ddaa9032116
    unknown: 2
  Profiles:
    Profile-exif: 65532 bytes

Code: Select all

convert DSC_0059.jpg tmp.tif

Code: Select all

identify -verbose tmp.tif

Code: Select all

 Properties:
    date:create: 2016-09-21T11:57:53-07:00
    date:modify: 2016-09-21T11:57:53-07:00
    signature: 9344ea039a694c89131031d53abc4655c49c5c4578ec7152a5459ddaa9032116
    tiff:alpha: unspecified
    tiff:endian: lsb
    tiff:photometric: RGB
    tiff:rows-per-strip: 5

I even tried adding -define tiff:exif-properties=true, but I suspect that define is really when reading tif files.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: potential bug JPG->TIF losing EXIF data

Post by magick »

ImageMagick relies on the libtiff delegate library to read and write TIFF images. The TIFF delegate library can read EXIF tags but cannot reliably write them. Try exiftool to write a EXIF profile to a TIFF image.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: potential bug JPG->TIF losing EXIF data

Post by fmw42 »

Curious what you mean by "reliably" write them. Does that mean it sometimes does?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: potential bug JPG->TIF losing EXIF data

Post by magick »

What we mean is that there were some attempts by the TIFF developers to support EXIF and they decided against completing the implementation suggesting it was a "rabbit hole." In previous versions of ImageMagick, we tried to support EXIF ourselves but we did not have much success so we abandoned the effort.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: potential bug JPG->TIF losing EXIF data

Post by fmw42 »

Thanks for the clarification.
Post Reply