用于处理 PNG 图像的 as3-xmp-file 库
as3-xmp-file 中所述的示例使用 .JPG 格式文件。 我尝试将 test.jpg 更改为 test.png 文件。但它似乎没有将标题更新到 .png 文件中。
任何人都知道如何做到这一点?
来自 as3-xmp-file 网站的代码
<?xml version="1.0" encoding="utf-8"?>
<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>
The example stated in as3-xmp-file is working with a .JPG format file.
I tried to change the test.jpg to an test.png file. But it does not seems to update the title up into the the .png file.
Anyone have any ideas how can this be done?
Code from as3-xmp-file website
<?xml version="1.0" encoding="utf-8"?>
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找不到该库的答案来写回代码,但我使用 这个问题
Could not find a answer for this library to write the code back in, but i subsitute it by using the code given from this question