Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Add XMP MetaData to JPG or TIFDownloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries C++ XMP example showing how to add XMP metadata to a JPG or TIFF that does not yet have XMP metadata embedded. void AppendXmp(void)
{
// Adds XMP metadata to a JPG or TIFF that does not yet contain
// embedded XMP metadata.
CkXmp xmp;
xmp.UnlockComponent("anything for 30-day trial");
bool success = xmp.LoadAppFile("scream.jpg");
if (!success)
{
xmp.SaveLastError("lastError.txt");
return;
}
// Intialize a new XMP metadata document.
CkXml xml;
xmp.NewXmp(xml);
// Add some properties:
// <exif:PixelXDimension>432</exif:PixelXDimension>
// <exif:PixelYDimension>288</exif:PixelYDimension>
xmp.AddSimpleInt(xml,"exif:PixelXDimension",432);
xmp.AddSimpleInt(xml,"exif:PixelYDimension",288);
// Append it and save the JPG. The "out.jpg" file now contains XMP metadata.
xmp.Append(xml);
xmp.SaveAppFile("out.jpg");
// Save the XMP to an XML file so we can see what was embedded.
xml.SaveXml("newXmp.xml");
return;
}
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.