0

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.

user1004413
  • 2,509
  • 6
  • 23
  • 33

1 Answers1

1

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:

  1. Download the as3_xmp_file, as3crypto and XMPCore libs
  2. Import the Flex Project archive files
  3. In the as3_xmp_file project under "Project" -> "Properties" -> "Build Path" -> "Library path" choose "Add project" and add the "XMPCore" project
  4. Create a new desktop application project
  5. In the new project under "Project" -> "Properties" -> "Build Path" -> "Library path" choose "Add project" and add the "as3_xmp_file" and "XMPCore" projects
  6. 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>
JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • yes, tried that didnt work out for me. it didnt write any jpg file . i am actually looking more of editing a specific XMP details to the jpg. trying to update images EXIF tags to value that i indicate – user1004413 Nov 06 '11 at 03:38
  • 1
    okay .. i managed to get that example working after all tries. that is add extra tags into the image file and it not updating the current EXIF tags that it have – user1004413 Nov 06 '11 at 05:00
  • Well, please share. Tell us why it didn't work and what you did to eventually get it working. If there are still open issues, add that info your original question. If not; post your own official answer and select it as such. – JeffryHouser Nov 06 '11 at 14:49
  • it was plainly me being careless. it needs to have the image at the file location inorder to work. – user1004413 Nov 07 '11 at 03:58
  • i know you're a new StackOverflow user; but I still suggest that you post your solution as a brand new answer; not as a comment to this one. That will help future folks who come across this question. – JeffryHouser Nov 07 '11 at 14:14
  • but its not the answer that i am expecting. I will like to know how to edit a certain EXIF tag field from that opensource – user1004413 Nov 09 '11 at 23:40
  • In that case, you should edit your question or post a new question asking that. – JeffryHouser Nov 09 '11 at 23:56