Added Canon Panorama patch, Canon test images, and minor updates (David Cannings)

v0.27.3
Andreas Huggel 19 years ago
parent 598940340d
commit b5d052b2f5

@ -14,9 +14,9 @@
# Only tested with GNU make.
#
TABLES = Exif Canon CanonCs CanonSi CanonCf CanonPi Fujifilm Minolta MinoltaCsNew \
MinoltaCs5D MinoltaCs7D Nikon1 Nikon2 Nikon3 Olympus Panasonic \
Sigma Sony
TABLES = Exif Canon CanonCs CanonSi CanonCf CanonPi CanonPa Fujifilm Minolta \
MinoltaCsNew MinoltaCs5D MinoltaCs7D Nikon1 Nikon2 Nikon3 Olympus \
Panasonic Sigma Sony
TAGLIST = ../../src/taglist

@ -49,7 +49,7 @@ Exif.Photo.ExposureTime (not used on write)</td>
<td>0x300b</td>
</tr>
<tr class="EvenRow">
<td>Exif.CanonCs1.*</td>
<td>Exif.CanonCs.*</td>
<td>0x102d</td>
<td>0x300b</td>
</tr>
@ -59,7 +59,7 @@ Exif.Photo.ExposureTime (not used on write)</td>
<td>0x300b</td>
</tr>
<tr class="EvenRow">
<td>Exif.Canon.PictureInfo</td>
<td>Exif.CanonPi.*</td>
<td>0x1038</td>
<td>0x300b</td>
</tr>

@ -24,6 +24,11 @@ __CanonCs__
__CanonSi__
<br>
<h3>Canon Panorama Tags</h3>
<p>Click on a column header to sort the table.</p>
__CanonPa__
<br>
<h3>Canon Custom Function Tags</h3>
<p>Click on a column header to sort the table.</p>
__CanonCf__

@ -62,6 +62,8 @@ namespace Exiv2 {
canonCsIfdId, MakerNote::AutoPtr(new CanonMakerNote));
MakerNoteFactory::registerMakerNote(
canonSiIfdId, MakerNote::AutoPtr(new CanonMakerNote));
MakerNoteFactory::registerMakerNote(
canonPaIfdId, MakerNote::AutoPtr(new CanonMakerNote));
MakerNoteFactory::registerMakerNote(
canonCfIfdId, MakerNote::AutoPtr(new CanonMakerNote));
MakerNoteFactory::registerMakerNote(
@ -70,6 +72,7 @@ namespace Exiv2 {
ExifTags::registerMakerTagInfo(canonIfdId, tagInfo_);
ExifTags::registerMakerTagInfo(canonCsIfdId, tagInfoCs_);
ExifTags::registerMakerTagInfo(canonSiIfdId, tagInfoSi_);
ExifTags::registerMakerTagInfo(canonPaIfdId, tagInfoPa_);
ExifTags::registerMakerTagInfo(canonCfIfdId, tagInfoCf_);
ExifTags::registerMakerTagInfo(canonPiIfdId, tagInfoPi_);
}
@ -82,6 +85,7 @@ namespace Exiv2 {
TagInfo(0x0002, "0x0002", "0x0002", "Unknown", canonIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0003, "0x0003", "0x0003", "Unknown", canonIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0004, "ShotInfo", "ShotInfo", "Shot information", canonIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0005, "Panorama", "Panorama", "Panorama", canonIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0006, "ImageType", "ImageType", "Image type", canonIfdId, makerTags, asciiString, printValue),
TagInfo(0x0007, "FirmwareVersion", "Firmware Version", "Firmware version", canonIfdId, makerTags, asciiString, printValue),
TagInfo(0x0008, "ImageNumber", "ImageNumber", "Image number", canonIfdId, makerTags, unsignedLong, print0x0008),
@ -413,6 +417,23 @@ namespace Exiv2 {
TagInfo(0xffff, "(UnknownCanonSiTag)", "(UnknownCanonSiTag)", "Unknown Canon Camera Settings 2 tag", canonSiIfdId, makerTags, invalidTypeId, printValue)
};
//! PanoramaDirection, tag 0x0005
extern const TagDetails canonPaDirection[] = {
{ 0, "Left to right" },
{ 1, "Right to left" },
{ 2, "Bottom to top" },
{ 3, "Top to bottom" },
{ 4, "2x2 matrix (Clockwise)" }
};
// Canon Panorama Info
const TagInfo CanonMakerNote::tagInfoPa_[] = {
TagInfo(0x0002, "PanoramaFrame", "PanoramaFrame", "Panorama frame number", canonPaIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0005, "PanoramaDirection", "PanoramaDirection", "Panorama direction", canonPaIfdId, makerTags, unsignedShort, EXV_PRINT_TAG(canonPaDirection)),
// End of list marker
TagInfo(0xffff, "(UnknownCanonCs2Tag)", "(UnknownCanonCs2Tag)", "Unknown Canon Panorama tag", canonPaIfdId, makerTags, invalidTypeId, printValue)
};
// Canon Custom Function Tag Info
const TagInfo CanonMakerNote::tagInfoCf_[] = {
TagInfo(0x0001, "NoiseReduction", "NoiseReduction", "Long exposure noise reduction", canonCfIfdId, makerTags, unsignedShort, printValue),
@ -510,6 +531,17 @@ namespace Exiv2 {
ifd_.erase(cs);
}
// Decode panorama information and add each as an additional entry
cs = ifd_.findTag(0x0005);
if (cs != ifd_.end() && cs->type() == unsignedShort) {
for (uint16_t c = 1; cs->count() > c; ++c) {
addCsEntry(canonPaIfdId, c, cs->offset() + c*2,
cs->data() + c*2, 1);
}
// Discard the original entry
ifd_.erase(cs);
}
// Decode custom functions and add each as an additional entry
cs = ifd_.findTag(0x000f);
if (cs != ifd_.end() && cs->type() == unsignedShort) {
@ -565,6 +597,7 @@ namespace Exiv2 {
assert( entry.ifdId() == canonIfdId
|| entry.ifdId() == canonCsIfdId
|| entry.ifdId() == canonSiIfdId
|| entry.ifdId() == canonPaIfdId
|| entry.ifdId() == canonCfIfdId
|| entry.ifdId() == canonPiIfdId);
// allow duplicates
@ -585,17 +618,23 @@ namespace Exiv2 {
ifd_.add(*i);
}
}
// Collect camera settings 1 entries and add the original Canon tag
Entry cs1;
if (assemble(cs1, canonCsIfdId, 0x0001, byteOrder_)) {
// Collect camera settings entries and add the original Canon tag
Entry cs;
if (assemble(cs, canonCsIfdId, 0x0001, byteOrder_)) {
ifd_.erase(0x0001);
ifd_.add(cs1);
ifd_.add(cs);
}
// Collect camera settings 2 entries and add the original Canon tag
Entry cs2;
if (assemble(cs2, canonSiIfdId, 0x0004, byteOrder_)) {
// Collect shot info entries and add the original Canon tag
Entry si;
if (assemble(si, canonSiIfdId, 0x0004, byteOrder_)) {
ifd_.erase(0x0004);
ifd_.add(cs2);
ifd_.add(si);
}
// Collect panorama entries and add the original Canon tag
Entry pa;
if (assemble(pa, canonPaIfdId, 0x0005, byteOrder_)) {
ifd_.erase(0x0005);
ifd_.add(pa);
}
// Collect custom function entries and add the original Canon tag
Entry cf;
@ -635,17 +674,23 @@ namespace Exiv2 {
ifd.add(*i);
}
}
// Collect camera settings 1 entries and add the original Canon tag
Entry cs1(alloc_);
if (assemble(cs1, canonCsIfdId, 0x0001, littleEndian)) {
// Collect camera settings entries and add the original Canon tag
Entry cs(alloc_);
if (assemble(cs, canonCsIfdId, 0x0001, littleEndian)) {
ifd.erase(0x0001);
ifd.add(cs1);
ifd.add(cs);
}
// Collect camera settings 2 entries and add the original Canon tag
Entry cs2(alloc_);
if (assemble(cs2, canonSiIfdId, 0x0004, littleEndian)) {
// Collect shot info entries and add the original Canon tag
Entry si(alloc_);
if (assemble(si, canonSiIfdId, 0x0004, littleEndian)) {
ifd.erase(0x0004);
ifd.add(cs2);
ifd.add(si);
}
// Collect panorama entries and add the original Canon tag
Entry pa(alloc_);
if (assemble(pa, canonPaIfdId, 0x0005, littleEndian)) {
ifd.erase(0x0005);
ifd.add(pa);
}
// Collect custom function entries and add the original Canon tag
Entry cf(alloc_);

@ -194,6 +194,7 @@ namespace Exiv2 {
static const TagInfo tagInfoSi_[];
static const TagInfo tagInfoCf_[];
static const TagInfo tagInfoPi_[];
static const TagInfo tagInfoPa_[];
}; // class CanonMakerNote

@ -65,6 +65,7 @@ namespace Exiv2 {
const uint16_t minocs5 = 275; //!< Minolta camera settings (D5)
const uint16_t minocs7 = 276; //!< Minolta camera settings (D7)
const uint16_t canonpi = 277; //!< Canon picture info
const uint16_t canonpa = 278; //!< Canon panorama
}
// *****************************************************************************

@ -70,6 +70,7 @@ namespace Exiv2 {
IfdInfo(canonSiIfdId, "Makernote", "CanonSi"),
IfdInfo(canonCfIfdId, "Makernote", "CanonCf"),
IfdInfo(canonPiIfdId, "Makernote", "CanonPi"),
IfdInfo(canonPaIfdId, "Makernote", "CanonPa"),
IfdInfo(fujiIfdId, "Makernote", "Fujifilm"),
IfdInfo(minoltaIfdId, "Makernote", "Minolta"),
IfdInfo(minoltaCs5DIfdId, "Makernote", "MinoltaCs5D"),

@ -91,7 +91,8 @@ namespace Exiv2 {
{ 274, "MinoltaCsNew" },
{ 275, "MinoltaCs5D" },
{ 276, "MinoltaCs7D" },
{ 277, "CanonPi" }
{ 277, "CanonPi" },
{ 278, "CanonPa" }
};
bool TiffGroupInfo::operator==(uint16_t group) const

@ -113,10 +113,12 @@ namespace Exiv2 {
// Canon makernote structure
{ 0x0001, Group::canonmn, newTiffArrayEntry<2>, Group::canoncs },
{ 0x0004, Group::canonmn, newTiffArrayEntry<2>, Group::canonsi },
{ 0x0005, Group::canonmn, newTiffArrayEntry<2>, Group::canonpa },
{ 0x000f, Group::canonmn, newTiffArrayEntry<2>, Group::canoncf },
{ 0x0012, Group::canonmn, newTiffArrayEntry<2>, Group::canonpi },
{ Tag::all, Group::canoncs, newTiffArrayElement<unsignedShort>, Group::canoncs },
{ Tag::all, Group::canonsi, newTiffArrayElement<unsignedShort>, Group::canonsi },
{ Tag::all, Group::canonpa, newTiffArrayElement<unsignedShort>, Group::canonpa },
{ Tag::all, Group::canoncf, newTiffArrayElement<unsignedShort>, Group::canoncf },
{ Tag::all, Group::canonpi, newTiffArrayElement<unsignedShort>, Group::canonpi },
// Some Olympus cameras use Minolta structures

@ -106,7 +106,7 @@ namespace Exiv2 {
enum IfdId { ifdIdNotSet,
ifd0Id, exifIfdId, gpsIfdId, iopIfdId, ifd1Id,
canonIfdId, canonCsIfdId, canonSiIfdId, canonCfIfdId,
canonPiIfdId,
canonPiIfdId, canonPaIfdId,
fujiIfdId,
minoltaIfdId, minoltaCs5DIfdId, minoltaCs7DIfdId,
minoltaCsOldIfdId, minoltaCsNewIfdId,

@ -69,6 +69,7 @@ try {
edMn1["Exif.CanonSi.0x0005"] = uint16_t(42);
edMn1["Exif.CanonCf.0x0001"] = uint16_t(43);
edMn1["Exif.CanonPi.0x0001"] = uint16_t(44);
edMn1["Exif.CanonPa.0x0001"] = uint16_t(45);
write(file, edMn1);
print(file);

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

@ -21,6 +21,7 @@ Exif.CanonSi.ISOSpeed 0x0002 Makernote Short 1
Exif.CanonSi.0x0003 0x0003 Makernote Short 1 0
Exif.CanonSi.TargetAperture 0x0004 Makernote Short 1 0
Exif.CanonSi.TargetShutterSpeed 0x0005 Makernote Short 1 42
Exif.CanonPa.0x0001 0x0001 Makernote Short 1 45
Exif.CanonCf.NoiseReduction 0x0001 Makernote Short 1 43
Exif.CanonPi.0x0001 0x0001 Makernote Short 1 44
@ -36,6 +37,7 @@ Exif.CanonSi.ISOSpeed 0x0002 Makernote Short 1
Exif.CanonSi.0x0003 0x0003 Makernote Short 1 0
Exif.CanonSi.TargetAperture 0x0004 Makernote Short 1 99
Exif.CanonSi.TargetShutterSpeed 0x0005 Makernote Short 1 42
Exif.CanonPa.0x0001 0x0001 Makernote Short 1 45
Exif.CanonCf.NoiseReduction 0x0001 Makernote Short 1 43
Exif.CanonPi.0x0001 0x0001 Makernote Short 1 44

@ -20,6 +20,10 @@ fi
diffargs="$da1 $da2"
(
# Add each image to the following three lists.
# The image basename in the second and third lists
# is the Exif timestamp adjusted by -12:01:01.
images="exiv2-empty.jpg \
exiv2-canon-powershot-s40.jpg \
exiv2-nikon-e990.jpg \
@ -31,7 +35,10 @@ images="exiv2-empty.jpg \
exiv2-sigma-d10.jpg \
exiv2-olympus-c8080wz.jpg \
exiv2-panasonic-dmc-fz5.jpg \
exiv2-sony-dsc-w7.jpg"
exiv2-sony-dsc-w7.jpg \
exiv2-canon-eos-20d.jpg \
exiv2-canon-eos-d30.jpg \
exiv2-canon-powershot-a520.jpg"
image2="exiv2-empty.jpg \
20031214_000043.jpg \
@ -44,7 +51,10 @@ image2="exiv2-empty.jpg \
20040316_075137.jpg \
20040208_093744.jpg \
20050218_212016.jpg \
20050527_051833.jpg"
20050527_051833.jpg \
20060802_095200.jpg \
20001004_015404.jpg \
20060127_225027.jpg"
image3="exiv2-empty.exv \
20031214_000043.exv \
@ -57,7 +67,10 @@ image3="exiv2-empty.exv \
20040316_075137.exv \
20040208_093744.exv \
20050218_212016.exv \
20050527_051833.exv"
20050527_051833.exv \
20060802_095200.exv \
20001004_015404.exv \
20060127_225027.exv"
for i in $images; do cp -f data/$i tmp/; done
echo "Exiv2 test directory -----------------------------------------------------"

Loading…
Cancel
Save