diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp index a7708c84..f7899121 100644 --- a/src/tiffimage.cpp +++ b/src/tiffimage.cpp @@ -1526,6 +1526,7 @@ namespace Exiv2 { Each entry of the table defines for a particular tag and group combination the corresponding TIFF component create function. */ +#define ignoreTiffComponent 0 const TiffGroupStruct TiffCreator::tiffGroupStruct_[] = { // ext. tag group create function //--------- ----------------- ----------------------------------------- @@ -1553,7 +1554,7 @@ namespace Exiv2 { { 0x0145, subImage1Id, newTiffImageSize<0x0144, subImage1Id> }, { 0x0201, subImage1Id, newTiffImageData<0x0202, subImage1Id> }, { 0x0202, subImage1Id, newTiffImageSize<0x0201, subImage1Id> }, - { Tag::next, subImage1Id, newTiffDirectory }, + { Tag::next, subImage1Id, ignoreTiffComponent }, { Tag::all, subImage1Id, newTiffEntry }, // Subdir subImage2 @@ -1563,7 +1564,7 @@ namespace Exiv2 { { 0x0145, subImage2Id, newTiffImageSize<0x0144, subImage2Id> }, { 0x0201, subImage2Id, newTiffImageData<0x0202, subImage2Id> }, { 0x0202, subImage2Id, newTiffImageSize<0x0201, subImage2Id> }, - { Tag::next, subImage2Id, newTiffDirectory }, + { Tag::next, subImage2Id, ignoreTiffComponent }, { Tag::all, subImage2Id, newTiffEntry }, // Subdir subImage3 @@ -1573,7 +1574,7 @@ namespace Exiv2 { { 0x0145, subImage3Id, newTiffImageSize<0x0144, subImage3Id> }, { 0x0201, subImage3Id, newTiffImageData<0x0202, subImage3Id> }, { 0x0202, subImage3Id, newTiffImageSize<0x0201, subImage3Id> }, - { Tag::next, subImage3Id, newTiffDirectory }, + { Tag::next, subImage3Id, ignoreTiffComponent }, { Tag::all, subImage3Id, newTiffEntry }, // Subdir subImage4 @@ -1583,7 +1584,7 @@ namespace Exiv2 { { 0x0145, subImage4Id, newTiffImageSize<0x0144, subImage4Id> }, { 0x0201, subImage4Id, newTiffImageData<0x0202, subImage4Id> }, { 0x0202, subImage4Id, newTiffImageSize<0x0201, subImage4Id> }, - { Tag::next, subImage4Id, newTiffDirectory }, + { Tag::next, subImage4Id, ignoreTiffComponent }, { Tag::all, subImage4Id, newTiffEntry }, // Subdir subImage5 @@ -1593,7 +1594,7 @@ namespace Exiv2 { { 0x0145, subImage5Id, newTiffImageSize<0x0144, subImage5Id> }, { 0x0201, subImage5Id, newTiffImageData<0x0202, subImage5Id> }, { 0x0202, subImage5Id, newTiffImageSize<0x0201, subImage5Id> }, - { Tag::next, subImage5Id, newTiffDirectory }, + { Tag::next, subImage5Id, ignoreTiffComponent }, { Tag::all, subImage5Id, newTiffEntry }, // Subdir subImage6 @@ -1603,7 +1604,7 @@ namespace Exiv2 { { 0x0145, subImage6Id, newTiffImageSize<0x0144, subImage6Id> }, { 0x0201, subImage6Id, newTiffImageData<0x0202, subImage6Id> }, { 0x0202, subImage6Id, newTiffImageSize<0x0201, subImage6Id> }, - { Tag::next, subImage6Id, newTiffDirectory }, + { Tag::next, subImage6Id, ignoreTiffComponent }, { Tag::all, subImage6Id, newTiffEntry }, // Subdir subImage7 @@ -1613,7 +1614,7 @@ namespace Exiv2 { { 0x0145, subImage7Id, newTiffImageSize<0x0144, subImage7Id> }, { 0x0201, subImage7Id, newTiffImageData<0x0202, subImage7Id> }, { 0x0202, subImage7Id, newTiffImageSize<0x0201, subImage7Id> }, - { Tag::next, subImage7Id, newTiffDirectory }, + { Tag::next, subImage7Id, ignoreTiffComponent }, { Tag::all, subImage7Id, newTiffEntry }, // Subdir subImage8 @@ -1623,7 +1624,7 @@ namespace Exiv2 { { 0x0145, subImage8Id, newTiffImageSize<0x0144, subImage8Id> }, { 0x0201, subImage8Id, newTiffImageData<0x0202, subImage8Id> }, { 0x0202, subImage8Id, newTiffImageSize<0x0201, subImage8Id> }, - { Tag::next, subImage8Id, newTiffDirectory }, + { Tag::next, subImage8Id, ignoreTiffComponent }, { Tag::all, subImage8Id, newTiffEntry }, // Subdir subImage9 @@ -1633,21 +1634,21 @@ namespace Exiv2 { { 0x0145, subImage9Id, newTiffImageSize<0x0144, subImage9Id> }, { 0x0201, subImage9Id, newTiffImageData<0x0202, subImage9Id> }, { 0x0202, subImage9Id, newTiffImageSize<0x0201, subImage9Id> }, - { Tag::next, subImage9Id, newTiffDirectory }, + { Tag::next, subImage9Id, ignoreTiffComponent }, { Tag::all, subImage9Id, newTiffEntry }, // Exif subdir { 0xa005, exifId, newTiffSubIfd }, { 0x927c, exifId, newTiffMnEntry }, - { Tag::next, exifId, newTiffDirectory }, + { Tag::next, exifId, ignoreTiffComponent }, { Tag::all, exifId, newTiffEntry }, // GPS subdir - { Tag::next, gpsId, newTiffDirectory }, + { Tag::next, gpsId, ignoreTiffComponent }, { Tag::all, gpsId, newTiffEntry }, // IOP subdir - { Tag::next, iopId, newTiffDirectory }, + { Tag::next, iopId, ignoreTiffComponent }, { Tag::all, iopId, newTiffEntry }, // IFD1 @@ -1668,7 +1669,7 @@ namespace Exiv2 { { 0x0145, subThumb1Id, newTiffImageSize<0x0144, subThumb1Id> }, { 0x0201, subThumb1Id, newTiffImageData<0x0202, subThumb1Id> }, { 0x0202, subThumb1Id, newTiffImageSize<0x0201, subThumb1Id> }, - { Tag::next, subThumb1Id, newTiffDirectory }, + { Tag::next, subThumb1Id, ignoreTiffComponent }, { Tag::all, subThumb1Id, newTiffEntry }, // IFD2 (eg, in Pentax PEF and Canon CR2 files) @@ -1688,14 +1689,14 @@ namespace Exiv2 { { 0x0145, ifd1Id, newTiffImageSize<0x0144, ifd3Id> }, { 0x0201, ifd3Id, newTiffImageData<0x0202, ifd3Id> }, { 0x0202, ifd3Id, newTiffImageSize<0x0201, ifd3Id> }, - { Tag::next, ifd3Id, newTiffDirectory }, + { Tag::next, ifd3Id, ignoreTiffComponent }, { Tag::all, ifd3Id, newTiffEntry }, // Olympus makernote - some Olympus cameras use Minolta structures // Todo: Adding such tags will not work (maybe result in a Minolta makernote), need separate groups { 0x0001, olympusId, EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg) }, { 0x0003, olympusId, EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg) }, - { Tag::next, olympusId, newTiffDirectory }, + { Tag::next, olympusId, ignoreTiffComponent }, { Tag::all, olympusId, newTiffEntry }, // Olympus2 makernote @@ -1717,7 +1718,7 @@ namespace Exiv2 { { 0x2800, olympus2Id, newTiffSubIfd }, { 0x2900, olympus2Id, newTiffSubIfd }, { 0x3000, olympus2Id, newTiffSubIfd }, - { Tag::next, olympus2Id, newTiffDirectory }, + { Tag::next, olympus2Id, ignoreTiffComponent }, { Tag::all, olympus2Id, newTiffEntry }, // Olympus2 equipment subdir @@ -1771,7 +1772,7 @@ namespace Exiv2 { { Tag::all, olympusRiId, newTiffEntry }, // Fujifilm makernote - { Tag::next, fujiId, newTiffDirectory }, + { Tag::next, fujiId, ignoreTiffComponent }, { Tag::all, fujiId, newTiffEntry }, // Canon makernote @@ -1782,7 +1783,7 @@ namespace Exiv2 { { 0x0012, canonId, EXV_SIMPLE_BINARY_ARRAY(canonPiCfg) }, { 0x0093, canonId, EXV_BINARY_ARRAY(canonFiCfg, canonFiDef) }, { 0x00a0, canonId, EXV_SIMPLE_BINARY_ARRAY(canonPrCfg) }, - { Tag::next, canonId, newTiffDirectory }, + { Tag::next, canonId, ignoreTiffComponent }, { Tag::all, canonId, newTiffEntry }, // Canon makernote composite tags @@ -1795,15 +1796,15 @@ namespace Exiv2 { { Tag::all, canonPrId, newTiffBinaryElement }, // Nikon1 makernote - { Tag::next, nikon1Id, newTiffDirectory }, + { Tag::next, nikon1Id, ignoreTiffComponent }, { Tag::all, nikon1Id, newTiffEntry }, // Nikon2 makernote - { Tag::next, nikon2Id, newTiffDirectory }, + { Tag::next, nikon2Id, ignoreTiffComponent }, { Tag::all, nikon2Id, newTiffEntry }, // Nikon3 makernote - { Tag::next, nikon3Id, newTiffDirectory }, + { Tag::next, nikon3Id, ignoreTiffComponent }, { 0x0011, nikon3Id, newTiffSubIfd }, { 0x001f, nikon3Id, EXV_BINARY_ARRAY(nikonVrCfg, nikonVrDef) }, { 0x0023, nikon3Id, EXV_BINARY_ARRAY(nikonPcCfg, nikonPcDef) }, @@ -1823,7 +1824,7 @@ namespace Exiv2 { // Nikon3 makernote preview subdir { 0x0201, nikonPvId, newTiffThumbData<0x0202, nikonPvId> }, { 0x0202, nikonPvId, newTiffThumbSize<0x0201, nikonPvId> }, - { Tag::next, nikonPvId, newTiffDirectory }, + { Tag::next, nikonPvId, ignoreTiffComponent }, { Tag::all, nikonPvId, newTiffEntry }, // Nikon3 vibration reduction @@ -1880,25 +1881,25 @@ namespace Exiv2 { { Tag::all, nikonLd3Id, newTiffBinaryElement }, // Panasonic makernote - { Tag::next, panasonicId, newTiffDirectory }, + { Tag::next, panasonicId, ignoreTiffComponent }, { Tag::all, panasonicId, newTiffEntry }, // Pentax DNG makernote { 0x0003, pentaxDngId, newTiffThumbSize<0x0004, pentaxDngId> }, { 0x0004, pentaxDngId, newTiffThumbData<0x0003, pentaxDngId> }, - { Tag::next, pentaxDngId, newTiffDirectory }, + { Tag::next, pentaxDngId, ignoreTiffComponent }, { Tag::all, pentaxDngId, newTiffEntry }, // Pentax makernote { 0x0003, pentaxId, newTiffThumbSize<0x0004, pentaxId> }, { 0x0004, pentaxId, newTiffThumbData<0x0003, pentaxId> }, - { Tag::next, pentaxId, newTiffDirectory }, + { Tag::next, pentaxId, ignoreTiffComponent }, { Tag::all, pentaxId, newTiffEntry }, // Samsung2 makernote { 0x0021, samsung2Id, EXV_BINARY_ARRAY(samsungPwCfg, samsungPwDef) }, { 0x0035, samsung2Id, newTiffSubIfd }, - { Tag::next, samsung2Id, newTiffDirectory }, + { Tag::next, samsung2Id, ignoreTiffComponent }, { Tag::all, samsung2Id, newTiffEntry }, // Samsung PictureWizard binary array @@ -1907,17 +1908,17 @@ namespace Exiv2 { // Samsung2 makernote preview subdir { 0x0201, samsungPvId, newTiffThumbData<0x0202, samsungPvId> }, { 0x0202, samsungPvId, newTiffThumbSize<0x0201, samsungPvId> }, - { Tag::next, samsungPvId, newTiffDirectory }, + { Tag::next, samsungPvId, ignoreTiffComponent }, { Tag::all, samsungPvId, newTiffEntry }, // Sigma/Foveon makernote - { Tag::next, sigmaId, newTiffDirectory }, + { Tag::next, sigmaId, ignoreTiffComponent }, { Tag::all, sigmaId, newTiffEntry }, // Sony1 makernote { 0x0114, sony1Id, EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, sonyCsSelector) }, { 0xb028, sony1Id, newTiffSubIfd }, - { Tag::next, sony1Id, newTiffDirectory }, + { Tag::next, sony1Id, ignoreTiffComponent }, { Tag::all, sony1Id, newTiffEntry }, // Sony1 camera settings @@ -1926,7 +1927,7 @@ namespace Exiv2 { // Sony2 makernote { 0x0114, sony2Id, EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, sonyCsSelector) }, - { Tag::next, sony2Id, newTiffDirectory }, + { Tag::next, sony2Id, ignoreTiffComponent }, { Tag::all, sony2Id, newTiffEntry }, // Sony2 camera settings @@ -1940,7 +1941,7 @@ namespace Exiv2 { { 0x0088, sonyMltId, newTiffThumbData<0x0089, sonyMltId> }, { 0x0089, sonyMltId, newTiffThumbSize<0x0088, sonyMltId> }, { 0x0114, sonyMltId, EXV_BINARY_ARRAY(sony1MCsA100Cfg, sony1MCsA100Def)}, - { Tag::next, sonyMltId, newTiffDirectory }, + { Tag::next, sonyMltId, ignoreTiffComponent }, { Tag::all, sonyMltId, newTiffEntry }, // Sony1 Minolta makernote composite tags @@ -1956,7 +1957,7 @@ namespace Exiv2 { { 0x0088, minoltaId, newTiffThumbData<0x0089, minoltaId> }, { 0x0089, minoltaId, newTiffThumbSize<0x0088, minoltaId> }, { 0x0114, minoltaId, EXV_BINARY_ARRAY(minoCs5Cfg, minoCs5Def) }, - { Tag::next, minoltaId, newTiffDirectory }, + { Tag::next, minoltaId, ignoreTiffComponent }, { Tag::all, minoltaId, newTiffEntry }, // Minolta makernote composite tags @@ -1974,20 +1975,20 @@ namespace Exiv2 { { 0x8825, panaRawId, newTiffSubIfd }, // { 0x0111, panaRawId, newTiffImageData<0x0117, panaRawId> }, // { 0x0117, panaRawId, newTiffImageSize<0x0111, panaRawId> }, - { Tag::next, panaRawId, newTiffDirectory }, + { Tag::next, panaRawId, ignoreTiffComponent }, { Tag::all, panaRawId, newTiffEntry }, // Casio makernote - { Tag::next, casioId, newTiffDirectory }, + { Tag::next, casioId, ignoreTiffComponent }, { Tag::all, casioId, newTiffEntry }, // Casio2 makernote - { Tag::next, casio2Id, newTiffDirectory }, + { Tag::next, casio2Id, ignoreTiffComponent }, { Tag::all, casio2Id, newTiffEntry }, // ----------------------------------------------------------------------- // Tags which are not de/encoded - { Tag::next, ignoreId, newTiffDirectory }, + { Tag::next, ignoreId, ignoreTiffComponent }, { Tag::all, ignoreId, newTiffEntry } }; diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp index e3e23d99..c3e31195 100644 --- a/src/tiffvisitor.cpp +++ b/src/tiffvisitor.cpp @@ -1229,7 +1229,7 @@ namespace Exiv2 { if (pos != dirList_.end()) { #ifndef SUPPRESS_WARNINGS EXV_ERROR << groupName(group) << " pointer references previously read " - << groupName(pos->second) << " directory. Ignored.\n"; + << groupName(pos->second) << " directory; ignored.\n"; #endif return true; } @@ -1313,7 +1313,7 @@ namespace Exiv2 { #ifndef SUPPRESS_WARNINGS if (tc.get() == 0) { EXV_WARNING << "Directory " << groupName(object->group()) - << " has an unhandled next pointer.\n"; + << " has an unexpected next pointer; ignored.\n"; } #endif } diff --git a/test/data/exiv2-test.out b/test/data/exiv2-test.out index 4ea6f7e4..a89ce4f5 100644 --- a/test/data/exiv2-test.out +++ b/test/data/exiv2-test.out @@ -171,11 +171,11 @@ Adjusting `Exif.Image.DateTime' by -43261s to 2005:05:27 05:18:33 Adjusting `Exif.Photo.DateTimeOriginal' by -43261s to 2005:05:27 05:18:33 Adjusting `Exif.Photo.DateTimeDigitized' by -43261s to 2005:05:27 05:18:33 File 13/15: exiv2-canon-eos-20d.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Adjusting `Exif.Image.DateTime' by -43261s to 2006:08:02 09:52:00 Adjusting `Exif.Photo.DateTimeOriginal' by -43261s to 2006:08:02 09:52:00 Adjusting `Exif.Photo.DateTimeDigitized' by -43261s to 2006:08:02 09:52:00 -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. File 14/15: exiv2-canon-eos-d30.jpg Adjusting `Exif.Image.DateTime' by -43261s to 2000:10:04 01:54:04 Adjusting `Exif.Photo.DateTimeOriginal' by -43261s to 2000:10:04 01:54:04 @@ -211,7 +211,7 @@ Renaming file to ./20050218_212016.jpg File 12/15: exiv2-sony-dsc-w7.jpg Renaming file to ./20050527_051833.jpg File 13/15: exiv2-canon-eos-20d.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Renaming file to ./20060802_095200.jpg File 14/15: exiv2-canon-eos-d30.jpg Renaming file to ./20001004_015404.jpg @@ -523,7 +523,7 @@ File 12/15: 20050527_051833.jpg 20050527_051833.jpg Exif comment : File 13/15: 20060802_095200.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. 20060802_095200.jpg File name : 20060802_095200.jpg 20060802_095200.jpg File size : 20733 Bytes 20060802_095200.jpg MIME type : image/jpeg @@ -1617,7 +1617,7 @@ File 12/15: 20050527_051833.jpg 20050527_051833.jpg Exif.Thumbnail.JPEGInterchangeFormat Long 1 2484 20050527_051833.jpg Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 15605 File 13/15: 20060802_095200.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. 20060802_095200.jpg Exif.Image.Make Ascii 6 Canon 20060802_095200.jpg Exif.Image.Model Ascii 14 Canon EOS 20D 20060802_095200.jpg Exif.Image.Orientation Short 1 top, left @@ -2147,7 +2147,7 @@ File 15/15: 20060127_225027.jpg 20060127_225027.jpg Exif.Thumbnail.JPEGInterchangeFormat Long 1 2548 20060127_225027.jpg Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 6137 exiv2-empty.jpg: (No Exif data found in the file) -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Extract Exif data -------------------------------------------------------- File 1/15: exiv2-empty.jpg @@ -2175,7 +2175,7 @@ Writing Exif data from 20050218_212016.jpg to ./20050218_212016.exv File 12/15: 20050527_051833.jpg Writing Exif data from 20050527_051833.jpg to ./20050527_051833.exv File 13/15: 20060802_095200.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Writing Exif data from 20060802_095200.jpg to ./20060802_095200.exv File 14/15: 20001004_015404.jpg Writing Exif data from 20001004_015404.jpg to ./20001004_015404.exv @@ -2208,7 +2208,7 @@ Writing thumbnail (image/jpeg, 10308 Bytes) to file ./20050218_212016-thumb.jpg File 12/15: 20050527_051833.jpg Writing thumbnail (image/jpeg, 15605 Bytes) to file ./20050527_051833-thumb.jpg File 13/15: 20060802_095200.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Writing thumbnail (image/jpeg, 6260 Bytes) to file ./20060802_095200-thumb.jpg File 14/15: 20001004_015404.jpg Writing thumbnail (image/jpeg, 13824 Bytes) to file ./20001004_015404-thumb.jpg @@ -5325,9 +5325,9 @@ Erasing thumbnail data File 12/15: 20050527_051833.jpg Erasing thumbnail data File 13/15: 20060802_095200.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Erasing thumbnail data -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. File 14/15: 20001004_015404.jpg Erasing thumbnail data File 15/15: 20060127_225027.jpg diff --git a/test/data/preview/preview-test.out b/test/data/preview/preview-test.out index f7fe2d0b..6c8e1d73 100644 --- a/test/data/preview/preview-test.out +++ b/test/data/preview/preview-test.out @@ -67,12 +67,12 @@ Exit code: 0 -----> exiv2-canon-eos-20d.jpg <----- Command: exiv2 -pp exiv2-canon-eos-20d.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Preview 1: image/jpeg, 160x120 pixels, 6260 bytes Exit code: 0 Command: exiv2 -f -ep exiv2-canon-eos-20d.jpg -Error: Directory Canon: Next pointer is out of bounds; ignored. +Warning: Directory Canon has an unexpected next pointer; ignored. Exit code: 0 -----> exiv2-canon-eos-300d.jpg <-----