Possible bug: Not copying over all EXIF tags curing TIFF to JPEG conversion
Posted: 2017-09-11T23:15:15-07:00
I'm adding some standard EXIF tags, using ExifTool, to the TIFF files generated by my scanner tools. The ImageMagick convert tool is not copying the tags over when converting from TIFF to JPEG, namely:
If I convert it using ImageMagick:
ExifTool shows the converted JPEG file contains the following tags:
Now if I copy the original TIFF file and use ExifTool to add the DateTime, DateTimeDigitized and DateTimeOriginal tags:
ExifTool shows the new TIFF to have the following tags (which include the newly added tags):
If I now convert that new TIFF to JPEG using ImageMagick and look at the tags in that JPEG file, the new tags in the TIFF file aren't the resultant JPEG file:
But I can add them back to the new JPEG file using ExifTool again:
Why doesn't the ImageMagick convert tool preserve the tags from the TIFF file into the new JPEG file?
EDIT: Added link to test TIFF
- DateTime (ModifyDate to exiftool)
- DateTimeDigitized (CreateDate to exiftool)
- DateTimeOriginal
Code: Select all
C:\TEMP\test>exiftool -v IMG_20170912_0001.tif
ExifToolVersion = 10.61
FileName = IMG_20170912_0001.tif
Directory = .
FileSize = 5303788
FileModifyDate = 1505192941.45003
FileAccessDate = 1505192958.3514
FileCreateDate = 1505192958.3514
FilePermissions = 33206
FileType = TIFF
FileTypeExtension = TIF
MIMEType = image/tiff
ExifByteOrder = II
+ [IFD0 directory with 14 entries]
| 0) SubfileType = 0
| 1) ImageWidth = 1788
| 2) ImageHeight = 988
| 3) BitsPerSample = 8 8 8
| 4) Compression = 1
| 5) PhotometricInterpretation = 2
| 6) StripOffsets = 8 10736 21464 32192 42920 53648 64376 75104 85832 96560 107288 1[snip]
| 7) SamplesPerPixel = 3
| 8) RowsPerStrip = 2
| 9) StripByteCounts = 10728 10728 10728 10728 10728 10728 10728 10728 10728 10728 1[snip]
| 10) XResolution = 300 (300000/1000)
| 11) YResolution = 300 (300000/1000)
| 12) PlanarConfiguration = 1
| 13) ResolutionUnit = 2
Code: Select all
C:\TEMP\test>convert -version
Version: ImageMagick 7.0.6-0 Q16 x64 2017-06-11 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
C:\TEMP\test>convert IMG_20170912_0001.tif -quality 95 IMG_20170912_0001.jpg
Code: Select all
C:\TEMP\test>exiftool -v IMG_20170912_0001.jpg
ExifToolVersion = 10.61
FileName = IMG_20170912_0001.jpg
Directory = .
FileSize = 1166897
FileModifyDate = 1505193588.30088
FileAccessDate = 1505193588.23837
FileCreateDate = 1505193468.87307
FilePermissions = 33206
FileType = JPEG
FileTypeExtension = JPG
MIMEType = image/jpeg
JPEG APP0 (14 bytes):
+ [BinaryData directory, 9 bytes]
| JFIFVersion = 1 1
| ResolutionUnit = 1
| XResolution = 300
| YResolution = 300
| ThumbnailWidth = 0
| ThumbnailHeight = 0
JPEG DQT (65 bytes):
JPEG DQT (65 bytes):
JPEG SOF0 (15 bytes):
ImageWidth = 1788
ImageHeight = 988
EncodingProcess = 0
BitsPerSample = 8
ColorComponents = 3
JPEG DHT (28 bytes):
JPEG DHT (85 bytes):
JPEG DHT (27 bytes):
JPEG DHT (93 bytes):
JPEG SOS
Code: Select all
C:\TEMP\test>copy IMG_20170912_0001.tif IMG_20170912_0002.tif
1 file(s) copied.
C:\TEMP\test>exiftool -exif:DateTimeOriginal="20170912 00:00:00" -exif:CreateDate="20170912 00:00:00" -exif:ModifyDate="20170912 00:00:00" IMG_20170912_0002.tif
1 image files updated
Code: Select all
C:\TEMP\test>exiftool -v IMG_20170912_0002.tif
ExifToolVersion = 10.61
FileName = IMG_20170912_0002.tif
Directory = .
FileSize = 5303950
FileModifyDate = 1505193366.22399
FileAccessDate = 1505193366.20836
FileCreateDate = 1505193007.81244
FilePermissions = 33206
FileType = TIFF
FileTypeExtension = TIF
MIMEType = image/tiff
ExifByteOrder = II
+ [IFD0 directory with 16 entries]
| 0) SubfileType = 0
| 1) ImageWidth = 1788
| 2) ImageHeight = 988
| 3) BitsPerSample = 8 8 8
| 4) Compression = 1
| 5) PhotometricInterpretation = 2
| 6) StripOffsets = 4318 15046 25774 36502 47230 57958 68686 79414 90142 100870 1115[snip]
| 7) SamplesPerPixel = 3
| 8) RowsPerStrip = 2
| 9) StripByteCounts = 10728 10728 10728 10728 10728 10728 10728 10728 10728 10728 1[snip]
| 10) XResolution = 300 (300000/1000)
| 11) YResolution = 300 (300000/1000)
| 12) PlanarConfiguration = 1
| 13) ResolutionUnit = 2
| 14) ModifyDate = 2017:09:12 00:00:00
| 15) ExifOffset (SubDirectory) -->
| + [ExifIFD directory with 6 entries]
| | 0) ExifVersion = 0231
| | 1) DateTimeOriginal = 2017:09:12 00:00:00
| | 2) CreateDate = 2017:09:12 00:00:00
| | 3) ComponentsConfiguration = 1 2 3 0
| | 4) FlashpixVersion = 0100
| | 5) ColorSpace = 65535
Code: Select all
C:\TEMP\test>convert IMG_20170912_0002.tif -quality 95 IMG_20170912_0002.jpg
C:\TEMP\test>exiftool -v IMG_20170912_0002.jpg
ExifToolVersion = 10.61
FileName = IMG_20170912_0002.jpg
Directory = .
FileSize = 1166897
FileModifyDate = 1505193772.48408
FileAccessDate = 1505193772.4216
FileCreateDate = 1505193772.4216
FilePermissions = 33206
FileType = JPEG
FileTypeExtension = JPG
MIMEType = image/jpeg
JPEG APP0 (14 bytes):
+ [BinaryData directory, 9 bytes]
| JFIFVersion = 1 1
| ResolutionUnit = 1
| XResolution = 300
| YResolution = 300
| ThumbnailWidth = 0
| ThumbnailHeight = 0
JPEG DQT (65 bytes):
JPEG DQT (65 bytes):
JPEG SOF0 (15 bytes):
ImageWidth = 1788
ImageHeight = 988
EncodingProcess = 0
BitsPerSample = 8
ColorComponents = 3
JPEG DHT (28 bytes):
JPEG DHT (85 bytes):
JPEG DHT (27 bytes):
JPEG DHT (93 bytes):
JPEG SOS
Code: Select all
C:\TEMP\test>exiftool -exif:DateTimeOriginal="20170912 00:00:00" -exif:CreateDate="20170912 00:00:00" -exif:ModifyDate="20170912 00:00:00" IMG_20170912_0002.jpg
1 image files updated
C:\TEMP\test>exiftool -v IMG_20170912_0002.jpg
ExifToolVersion = 10.61
FileName = IMG_20170912_0002.jpg
Directory = .
FileSize = 1167147
FileModifyDate = 1505194089.85091
FileAccessDate = 1505194089.83525
FileCreateDate = 1505193772.4216
FilePermissions = 33206
FileType = JPEG
FileTypeExtension = JPG
MIMEType = image/jpeg
JPEG APP0 (14 bytes):
+ [BinaryData directory, 9 bytes]
| JFIFVersion = 1 1
| ResolutionUnit = 1
| XResolution = 300
| YResolution = 300
| ThumbnailWidth = 0
| ThumbnailHeight = 0
JPEG APP1 (246 bytes):
ExifByteOrder = MM
+ [IFD0 directory with 6 entries]
| 0) XResolution = 300 (300/1)
| 1) YResolution = 300 (300/1)
| 2) ResolutionUnit = 2
| 3) ModifyDate = 2017:09:12 00:00:00
| 4) YCbCrPositioning = 1
| 5) ExifOffset (SubDirectory) -->
| + [ExifIFD directory with 6 entries]
| | 0) ExifVersion = 0231
| | 1) DateTimeOriginal = 2017:09:12 00:00:00
| | 2) CreateDate = 2017:09:12 00:00:00
| | 3) ComponentsConfiguration = 1 2 3 0
| | 4) FlashpixVersion = 0100
| | 5) ColorSpace = 65535
JPEG DQT (65 bytes):
JPEG DQT (65 bytes):
JPEG SOF0 (15 bytes):
ImageWidth = 1788
ImageHeight = 988
EncodingProcess = 0
BitsPerSample = 8
ColorComponents = 3
JPEG DHT (28 bytes):
JPEG DHT (85 bytes):
JPEG DHT (27 bytes):
JPEG DHT (93 bytes):
JPEG SOS
EDIT: Added link to test TIFF