Working Example for as3-xmp library
-
22-02-2021 - |
Frage
I tried using the AS3-XMP Library to read metadata of the files, but i have no idea what methods to use.
Anyway one has any working example? so that i could learn from it? i manage to read all the TIFF structure / tags data, but i would like to know how to write it.
Lösung
Did you follow all instructions here? Review the init function of the code sample for "how do I use this" reasons.
I'll repeat the full instructions below:
- Download the as3_xmp_file, as3crypto and XMPCore libs
- Import the Flex Project archive files
- In the as3_xmp_file project under "Project" -> "Properties" -> "Build Path" -> "Library path" choose "Add project" and add the "XMPCore" project
- Create a new desktop application project
- In the new project under "Project" -> "Properties" -> "Build Path" -> "Library path" choose "Add project" and add the "as3_xmp_file" and "XMPCore" projects
- Insert the following source into your new projects main mxml file
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
import de.qwesda.as3_xmp_file.as3_xmp_file;
import com.adobe.xmp.*;
private function init():void {
var file1:as3_xmp_file = new as3_xmp_file(File.desktopDirectory.nativePath + "/test.jpg");
if(file1.file.exists){
trace(file1.xmp.dumpObject());
var dc_exif:Namespace = XMPConst.dc;
file1.xmp.dc_exif::title = "Title";
file1.save();
}
var file2:as3_xmp_file = new as3_xmp_file(File.desktopDirectory.nativePath + "/test.jpg");
if(file2.file.exists){
trace(file2.xmp.dumpObject());
}
}
]]>
</mx:Script>
</mx:WindowedApplication>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow