Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Update a String Property in XMPDemonstrates how to open a JPG or TIF image file, access the XMP metadata, and update the value of a string property. (If the string property does not already exist, it is created.)
load ./chilkat.dll # This example assumes the Chilkat API to have been previously unlocked. # See Global Unlock Sample for sample code. set xmp [new_CkXmp] # Load a JPG or TIF image file. set success [CkXmp_LoadAppFile $xmp "qa_data/xmp/AJ_123642_1511.tif"] if {$success != 1} then { puts [CkXmp_lastErrorText $xmp] delete_CkXmp $xmp exit } puts "Num embedded XMP docs: [CkXmp_get_NumEmbedded $xmp]" # This example assumes that XMP metadata is already present in the image file. if {[CkXmp_get_NumEmbedded $xmp] == 0} then { puts "No XMP metadata already exists.." delete_CkXmp $xmp exit } # Get the XMP metadata. # xml is a CkXml set xml [CkXmp_GetEmbedded $xmp 0] # Show the XML: puts [CkXml_getXml $xml] # Update (overwrite) a string property. CkXmp_AddSimpleStr $xmp $xml "NumberofTimes" "123" set success [CkXmp_SaveAppFile $xmp "qa_output/updated.tif"] if {$success != 1} then { puts [CkXmp_lastErrorText $xmp] delete_CkXmp $xmp exit } puts "Success." delete_CkXmp $xmp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.