as3-xmp库的工作示例

时间:2011-11-05 03:12:25

标签: actionscript-3 flex flash-builder xmp

我尝试使用AS3-XMP Library来读取文件的元数据,但我不知道使用哪种方法。

无论如何,有人有任何工作的例子吗?这样我才能从中吸取教训? 我设法读取所有TIFF结构/标签数据,但我想知道如何编写它。

1 个答案:

答案 0 :(得分:1)

您是否关注了所有instructions here?查看代码示例的init函数,了解“我如何使用此”的原因。

我将重复以下完整说明:

  1. 下载as3_xmp_file,as3cryptoXMPCore libs
  2. 导入Flex Project存档文件
  3. 在“Project”下的as3_xmp_file项目中 - > “属性” - > “构建路径” - > “库路径”选择“添加项目”并添加 “XMPCore”项目
  4. 创建新的桌面应用程序项目
  5. 在“项目”下的新项目中 - > “属性” - > “建立路径” - > “库路径”选择“添加项目”并添加“as3_xmp_file”和“XMPCore”项目
  6. 将以下来源插入新项目主mxml文件
  7. <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>
    
相关问题