Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Add XMP MetaData to JPG or TIF 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;
}
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.