SetEXIFData



  • The possibilities this application offers, are: renaming photos or videos, get EXIF dates/times from the file name of the photo or video, increment dates.
  • It crashed when setExifData tried to parse a double. (As a result, the pictures from font camera did not show in gallery until the device rebooted) If someone is interested, I can post/share full code. All Credit to Fr4gg0r - Attached to Post, Modded Camera.apk (Froyo 2.2 Only).
This page is a wiki. Please login or create an account to begin editing.

There are a few exif related tools on the Mac App Store (just search for Exif) but I ended up finding this one, free, that did the job. After adding/changing the date/time info of the photo files on my Mac, the photos got properly presented in the Dropbox 'timeline' view - no more 'missing dates' section. Overview SetEXIFData writes the most wanted EXIF data in an image- or movie-file. Use a date from the Finder or retrieve the date/time from its file name, if present You can add and increment EXIF dates, times and sequence numbers. Using the print function from Example1 shows the following Exif tags in the image. Note the tag Exif.Image.ExifTag: It is required by the Exif standard because the metadata contains an Exif.Photo. tag and is automatically added by Exiv2 to ensure that the Exif structure is valid.


Rating:
Category:
Year released:
Author:Phil Harvey & Marc Vos
Publisher:
[www].se [ftp].se [mirror].us [mirror].de
setexifdata-ub.dmg (9.55 MB)
MD5: 896065e69757c49ee038b9d320548ad9
For Mac OS X
[www].se [ftp].se [mirror].us [mirror].de
ExifTool-10.27.dmg (2.57 MB)
MD5: f6b186306064ee4922a2e635bcb5e5a2
For Mac OS X
Emulation
Guides on emulating older applications

Phil Harvey's ExifTool ( http://www.sno.phy.queensu.ca/~phil/exiftool/ ) is the backend of many Image Browsers/Editors and offers unbeaten power in editing Exif tags, Metadata, GeoData, Keywords and even Color Profile Embeds and Assignment. It can be used in Terminal, but like all Killer Terminal Apps, we always wish the was a GUI - Well NOW there is - for Tiger!

Contacted Marc Vos: Maker of the Mactel ExifTool GUI app 'SetEXIFDATA' ( http://marc.vos.net/downloads/setexifdata/ ) because his site had a Universal Binary icon on it, and even though the current version won't start on PPC. Marc Siezed on the chance to pull his old G4 Cube out of the closet and compiled a version of this amazing app for all of us Luddite's to enjoy - and it WORKS! Add, Remove, Edit virtually any piece of an image's Metadata without having to recompress/resave it.

1st Download ) SetEXIFDATA application. (SetEXIFDATA requires ExifTool to be installed and Marc's app comes with version 10.11).

2nd Download ) ExifTool - Current Version - 10.27 (works fine on most Tiger systems).

Compatibility
Architecture: PPC

10.4/PPC (Not Tested on 10.3 or 10.5 - presumed to work).

Example 1: exifprint.cpp

This is a very simple program to read and print the Exif metadataof an image. Go to Example2 to see how theoutput looks like.

// ***************************************************************** -*- C++ -*-
// Sample program to print the Exif metadata of an image
#include <exiv2/exiv2.hpp>
#include <iostream>

Set Exif Data Serial

#include <cassert>
int main(int argc, char* const argv[])
std::cout << 'Usage: ' << argv[0] << ' filen';
}
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(argv[1]);
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
std::string error(argv[1]);
throwExiv2::Error(1, error);
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< '0x' << std::setw(4) << std::setfill('0') << std::right
<< std::setw(9) << std::setfill(' ') << std::left
<< std::dec << std::setw(3)
<< i->count() << ' '
<< 'n';
}
//catch (Exiv2::AnyError& e) {
std::cout << 'Caught Exiv2 exception ' << e.what() << 'n';
}

Example 2: addmoddel.cpp

Sample usage of high-level Exiv2 library calls to add, modify and delete Exif metadata.

// ***************************************************************** -*- C++ -*-
// Sample program showing how to add, modify and delete Exif metadata.
#include <exiv2/exiv2.hpp>
#include <iostream>
#include <cassert>
int main(int argc, char* const argv[])
if (argc != 2) {
return 1;
std::string file(argv[1]);
// Container for exif metadata. This is an example of creating
// exif metadata from scratch. If you want to add, modify, delete
// metadata that exists in an image, start with ImageFactory::open
// *************************************************************************
// This is the quickest way to add (simple) Exif data. If a metadatum for
// a given key already exists, its value is overwritten. Otherwise a new
exifData['Exif.Image.Model'] = 'Test 1'; // AsciiValue
exifData['Exif.Image.SamplesPerPixel'] = uint16_t(162); // UShortValue
exifData['Exif.Image.XResolution'] = int32_t(-2); // LongValue
exifData['Exif.Image.YResolution'] = Exiv2::Rational(-2, 3); // RationalValue
std::cout << 'Added a few tags the quick way.n';
// Create a ASCII string value (note the use of create)
Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);
v->read('1999:12:31 23:59:59');
// Add the value together with its key to the Exif data container
Exiv2::ExifKey key('Exif.Photo.DateTimeOriginal');
std::cout << 'Added key ' << key << ', value ' << *v << 'n';
// Now create a more interesting value (without using the create method)
Exiv2::URationalValue::AutoPtr rv(newExiv2::URationalValue);
rv->read('1/2 1/3');
// Add more elements through the extended interface of rational value
rv->value_.push_back(std::make_pair(3,4));
key = Exiv2::ExifKey('Exif.Image.PrimaryChromaticities');
std::cout << 'Added key ' << key << ', value ' << *rv << 'n';
// *************************************************************************
// Since we know that the metadatum exists (or we don't mind creating a new
Exiv2::Exifdatum& tag = exifData['Exif.Photo.DateTimeOriginal'];
date.replace(0, 4, '2000');
std::cout << 'Modified key ' << tag.key()
key = Exiv2::ExifKey('Exif.Image.PrimaryChromaticities');
Exiv2::ExifData::iterator pos = exifData.findKey(key);
if (pos exifData.end()) throwExiv2::Error(1, 'Key not found');
v = pos->getValue();
Exiv2::URationalValue* prv = dynamic_cast<Exiv2::URationalValue*>(v.release());
if (prv 0) throwExiv2::Error(1, 'Downcast failed');
// Modify the value directly through the interface of URationalValue
// Copy the modified value back to the metadatum
std::cout << 'Modified key ' << key
// *************************************************************************
key = Exiv2::ExifKey('Exif.Image.PrimaryChromaticities');
if (pos exifData.end()) throwExiv2::Error(1, 'Key not found');
std::cout << 'Deleted key ' << key << 'n';
// *************************************************************************
// Finally, write the remaining Exif data to the image file
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file);
image->writeMetadata();
return 0;
catch (Exiv2::AnyError& e) {
std::cout << 'Caught Exiv2 exception ' << e << 'n';
}

Using the print function from Example1 shows the following Exif tags in the image. Note the tag Exif.Image.ExifTag: It is required by the Exif standard because the metadata contains an Exif.Photo.* tag and is automatically added by Exiv2 to ensure that the Exif structure is valid.

Example 3: iptcprint.cpp

This is a very simple program to read and print the IPTC metadata of an image.

// ***************************************************************** -*- C++ -*-
// Sample program to print the IPTC metadata of an image
#include <exiv2/exiv2.hpp>
#include <iostream>
#include <cassert>
int main(int argc, char* const argv[])
std::cout << 'Usage: ' << argv[0] << ' filen';
}
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(argv[1]);
image->readMetadata();
Exiv2::IptcData &iptcData = image->iptcData();
std::string error(argv[1]);
throwExiv2::Error(1, error);
for (Exiv2::IptcData::iterator md = iptcData.begin(); md != end; ++md) {
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< '0x' << std::setw(4) << std::setfill('0') << std::right

Setexifdata

SetEXIFData
<< std::setw(9) << std::setfill(' ') << std::left
<< std::dec << std::setw(3)
<< md->count() << ' '
<< std::endl;
}
std::cout << 'Caught Exiv2 exception ' << e << 'n';
}

Image with the IPTC data
from examples 3 & 4

Example 4: iptceasy.cpp

This shows the quickest way to access, set or modify IPTC metadata, which is similar to how std::map works.The sample program writes the IPTC data to a file. Example 3, above, has the image with this IPTC data.

// ***************************************************************** -*- C++ -*-
// The quickest way to access, set or modify IPTC metadata.
#include <exiv2/exiv2.hpp>
#include <iostream>
#include <cassert>
int main(int argc, char* const argv[])
if (argc != 2) {
return 1;
std::string file(argv[1]);
Exiv2::IptcData iptcData;
iptcData['Iptc.Application2.Headline'] = 'The headline I am';
iptcData['Iptc.Application2.Keywords'] = 'Yet another keyword';
iptcData['Iptc.Application2.DateCreated'] = '2004-8-3';
iptcData['Iptc.Application2.Urgency'] = uint16_t(1);
iptcData['Iptc.Envelope.TimeSent'] = '14:41:0-05:00';
iptcData['Iptc.Application2.RasterizedCaption'] = '230 42 34 2 90 84 23 146';
value.read('very!');
std::cout << 'Time sent: ' << iptcData['Iptc.Envelope.TimeSent'] << 'n';
// Open image file
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file);
SetEXIFData
image->setIptcData(iptcData);
}
std::cout << 'Caught Exiv2 exception ' << e << 'n';
}

Example 5: xmpsample.cpp

Sample (test) usage of high level XMP classes. This example shows various aspects of setting XMP metadata, including complex types. See also Example 2: addmoddel.cpp

// ***************************************************************** -*- C++ -*-
// Sample/test for high level XMP classes. See also addmoddel.cpp
#include <exiv2/exiv2.hpp>
#include <string>
#include <iomanip>
#include <cmath>
bool isEqual(float a, float b)
double d = std::fabs(a - b);
}
int main()
// The XMP property container
// -------------------------------------------------------------------------
// Teaser: Setting XMP properties doesn't get much easier than this:
xmpData['Xmp.dc.source'] = 'xmpsample.cpp'; // a simple text value
xmpData['Xmp.dc.subject'] = 'Palmtree'; // an array item
xmpData['Xmp.dc.subject'] = 'Rubbertree'; // add a 2nd array item
// a language alternative with two entries and without default
xmpData['Xmp.dc.title'] = 'lang=de-DE Sonnenuntergang am Strand';
xmpData['Xmp.dc.title'] = 'lang=en-US Sunset on the beach';
// -------------------------------------------------------------------------
// Any properties can be set provided the namespace is known. Values of any
// type can be assigned to an Xmpdatum, if they have an output operator. The
// default XMP value type for unknown properties is a simple text value.
xmpData['Xmp.dc.one'] = -1;
Set exif data crack
xmpData['Xmp.dc.three'] = Exiv2::Rational(5, 7);
xmpData['Xmp.dc.five'] = int32_t(256);

Set Exif Data Crack

// In addition, there is a dedicated assignment operator for Exiv2::Value
xmpData['Xmp.dc.seven'] = val;
assert(xmpData['Xmp.dc.one'].toLong() -1);
constExiv2::Value &getv1 = xmpData['Xmp.dc.one'].value();
assert(getv1.ok());
assert(getv1.toRational() Exiv2::Rational(-1, 1));
constExiv2::Value &getv2 = xmpData['Xmp.dc.two'].value();
assert(getv2.ok());
assert(getv2.ok());
assert(getv2.ok());
Data
assert(isEqual(static_cast<float>(R.first) / R.second, 3.1415f ));
constExiv2::Value &getv3 = xmpData['Xmp.dc.three'].value();
assert(getv3.ok());
assert(getv3.ok());
assert(getv3.toRational() Exiv2::Rational(5, 7));
constExiv2::Value &getv6 = xmpData['Xmp.dc.six'].value();
assert(getv6.ok());
assert(getv6.ok());
assert(getv6.toRational() Exiv2::Rational(0, 1));
constExiv2::Value &getv7 = xmpData['Xmp.dc.seven'].value();
assert(!getv7.ok());
constExiv2::Value &getv8 = xmpData['Xmp.dc.eight'].value();
assert(getv8.ok());
assert(getv8.ok());
assert(getv8.toRational() Exiv2::Rational(1, 1));
Exiv2::XmpData::iterator pos = xmpData.findKey(Exiv2::XmpKey('Xmp.dc.eight'));
if (pos xmpData.end()) throwExiv2::Error(1, 'Key not found');
// -------------------------------------------------------------------------
// Exiv2 has specialized values for simple XMP properties, arrays of simple
// Add a simple XMP property in a known namespace
Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText);
xmpData.add(Exiv2::XmpKey('Xmp.dc.format'), v.get());
// Add an ordered array of text values.
v = Exiv2::Value::create(Exiv2::xmpSeq); // or xmpBag or xmpAlt.
v->read('1) The first creator'); // The sequence in which the array
v->read('2) The second creator'); // elements are added is their
v->read('3) And another one'); // order in the array.
xmpData.add(Exiv2::XmpKey('Xmp.dc.creator'), v.get());
// Add a language alternative property
v->read('lang=de-DE Hallo, Welt'); // The default doesn't need a
xmpData.add(Exiv2::XmpKey('Xmp.dc.description'), v.get());
// According to the XMP specification, Xmp.tiff.ImageDescription is an
// alias for Xmp.dc.description. Exiv2 treats an alias just like any
// other property and leaves it to the application to implement specific
xmpData['Xmp.tiff.ImageDescription'] = 'TIFF image description';
xmpData['Xmp.tiff.ImageDescription'] = 'lang=de-DE TIFF Bildbeschreibung';
// -------------------------------------------------------------------------
// Register a namespace which Exiv2 doesn't know yet. This is only needed
// when properties are added manually. If the XMP metadata is read from an
// image, namespaces are decoded and registered at the same time.
Exiv2::XmpProperties::registerNs('myNamespace/', 'ns');
// -------------------------------------------------------------------------
xmpData['Xmp.ns.myProperty'] = 'myValue';
// -------------------------------------------------------------------------
// There are no specialized values for structures, qualifiers and nested
// types. However, these can be added by using an XmpTextValue and a path as
Exiv2::XmpTextValue tv('16');
xmpData.add(Exiv2::XmpKey('Xmp.xmpDM.videoFrameSize/stDim:w'), &tv);
xmpData.add(Exiv2::XmpKey('Xmp.xmpDM.videoFrameSize/stDim:h'), &tv);
xmpData.add(Exiv2::XmpKey('Xmp.xmpDM.videoFrameSize/stDim:unit'), &tv);
// Add an element with a qualifier (using the namespace registered above)
xmpData['Xmp.dc.publisher'] = 'James Bond'; // creates an unordered array
xmpData['Xmp.dc.publisher[1]/?ns:role'] = 'secret agent';
// Add a qualifer to an array element of Xmp.dc.creator (added above)
xmpData.add(Exiv2::XmpKey('Xmp.dc.creator[2]/?ns:role'), &tv);
// Add an array of structures
tv.setXmpArrayType(Exiv2::XmpValue::xaBag);
xmpData.add(Exiv2::XmpKey('Xmp.xmpBJ.JobRef'), &tv); // Set the array type.
tv.setXmpArrayType(Exiv2::XmpValue::xaNone);
xmpData.add(Exiv2::XmpKey('Xmp.xmpBJ.JobRef[1]/stJob:name'), &tv);
xmpData.add(Exiv2::XmpKey('Xmp.xmpBJ.JobRef[1]/stJob:role'), &tv);
tv.read('Wedding ceremony');
xmpData.add(Exiv2::XmpKey('Xmp.xmpBJ.JobRef[2]/stJob:name'), &tv);
xmpData.add(Exiv2::XmpKey('Xmp.xmpBJ.JobRef[2]/stJob:role'), &tv);
// Add a creator contact info structure
Set exif data serial
xmpData['Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity'] = 'Kuala Lumpur';
xmpData['Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCtry'] = 'Malaysia';

Descargar Setexifdata

xmpData['Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork'] = 'http://www.exiv2.org';
// -------------------------------------------------------------------------
for (Exiv2::XmpData::const_iterator md = xmpData.begin();
std::cout << std::setfill(' ') << std::left
<< md->key() << ' '
<< std::setw(9) << std::setfill(' ') << std::left
<< std::dec << std::setw(3)
<< md->count() << ' '
<< std::endl;
// -------------------------------------------------------------------------
// Serialize the XMP data and output the XMP packet
if (0 != Exiv2::XmpParser::encode(xmpPacket, xmpData)) {
throwExiv2::Error(1, 'Failed to serialize XMP data');

Set Exif Data Tool

std::cout << xmpPacket << 'n';

Setexifdata

// Cleanup
}
std::cout << 'Caught Exiv2 exception ' << e << 'n';

Set Exif Data Program

}

The resulting XMP Exiv2 metadata and XMP packet is below.The same can be achieved with a set of commandsto the Exiv2 command line tool.