Adding/Reading XMP Metadata in a psd file

Hi,
I'm having some troubles to understand how to add and read XMP metadata on a psd file. I followed the Panel developer guide tutorial, and try to look on the internet for some answers, but I'm still stuck ...
Here is the simple example I'm trying to make (using part of the code from the panel developer guide) :
     The function loads the XMP Script Library.
     @returns True if the XMP Script Library was loaded successfully.
     @type Boolean
function loadXMPLibrary(){
     if ( !ExternalObject.AdobeXMPScript ){
          try{
               ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
          }catch (e){
               alert("Can't load XMP Script Library");
               return false;
     return true;
     The function unloads the XMP Script Library.
function unloadXMPLibrary(){
     if( ExternalObject.AdobeXMPScript ) {
          try{
               ExternalObject.AdobeXMPScript.unload();
               ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
               alert("Can't unload XMP Script Library");
    Try to put a new property into the metadata
if( app.activeDocument || !loadXMPLibrary()){
    var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
    xmp.setProperty( XMPConst.NS_EXIF, "myProperty", "test" );
    activeDocument.xmpMetadata.rawData = xmp.serialize();
    unloadXMPLibrary();
    Window.alert(activeDocument.xmpMetadata.rawData);
I don't really know where I'm wrong, could you help me please ?
Thanks,
Julien

Rather mess with EXIF and Dublin Core namespaces, wouldn't it be better to create your own?
IE:
#target photoshop
addtoMeta();
function addtoMeta(){
if(!documents.length) return;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
var myNamespace = "http://my.fantastic.newspace/";
var myPrefix = "nsfns:";
XMPMeta.registerNamespace(myNamespace, myPrefix);
xmp.setProperty(myNamespace, "myProperty", "A Test String");
app.activeDocument.xmpMetadata.rawData = xmp.serialize();

Similar Messages

  • How to read XMP metadata of an indd file using Actionscript

    Hi All,
    I am trying to read XMP metadata of an indd file using CS Extension Builder in Flash Builder 4.5.
    The documentation has many class like XMPmeta, XMPStruct, etc.
    I have got the currently opened document in InDesign as follows:
    var myDoc:Document = InDesign.app.activeDocument();
    And a new XMPmeta object is created as follows:
    var myXMP:XMPMeta = new XMPMeta();
    How to initialize document's xmp metadata in the XMPMeta object? Or is there any other way to get the XMP metadata of currently opened document in InDesign?

    I have found that the XMP data of an InDesign document can be retrieved in actionscript as follows:
    InDesign.app.activeDocument.metadataPreferences
    This returns the MetadataPreference object.
    But I am not able to iterate each namespace in the xmp. There isn't any XMPFile class which allows me to serialize the object to xml file so that I can iterate all elements in the XMP.
    I could not relate class like XMPMeta, XMPProp, etc. with the MetaDataPreference class. So, how to obtain the entire xmp packet from the MetadataPreference object?
    Can anyone shed light on this?

  • XMP metadata lost from PNG files after saveing

    Hello,
    i am using Photosop CS3 SDK. through my plug-in I put some metadata in the file using XMP SDK 4.4.2.
    For PNG files, if the file is modified and saved, all the XMP metadata is lost from the file.
    The following steps are being done.
    1. Put some metadata in PNG file using SXMPMeta::SetProperty and SXMPMeta::AppendArrayItem
    2. modify the file (changed brightness, contrast, flattened the image).
    3. Save this file.
    After saving all the xmp metadata is lost from the PNG file. This works for all other formats.
    What can be wrong that I am doing?
    Is there any other way to put XMP metadata in file?
    Thanks,
    Hitesh

    That's probably because PNG doesn't save or read XMP metadata.
    There really aren't standards for metadata in PNG. (though a few products have tried adding it in ad-hoc ways, without documenting their efforts)

  • Saving Metadata to large PSD file problems

    LR 2.1
    XP Pro SP 3
    4GB Ram
    Dual Dual-core 3.6 Processsors (HP workstation)
    Dual Dual-channel FC Arrays (4G/min)
    LR 2.1 is consistantly failing to export metadata information to PSD files over 200Meg. Most of these files are layered.
    Stuff under that seems AOK.
    Any thoughts.

    How are you saving the metadata - automatically or manually?

  • Bridge locks briefly when updating metadata on large PSD files

    When updating metadata on a large PSD file, Bridge "locks" up for a brief period of time. This is apparently when it's rewriting that large PSD file to update the metadata. I'd like to be able to use Bridge in an uninterrupted fashion while metadata is updated in the background. This normally works for smaller files, just not on large PSD files. You can reproduce this easily by just adding a keyword to a couple 100MB PSD files.
    --John

    Chris,
    How large are the PSD files? If they are over 400MB, I think I know what's wrong.
    Bridge has a file-size preference, and won't process files that are larger than your setting. You'll find this preference on the Thumbnails panel in the Bridge Preferences dialog. The default is 400MB--try bumping it up to a size larger than your largest PSD and then purge the cache for the folder containing those PSDs.
    If that does not work, I'd like to have a copy of one of the PSDs that is not working for you.
    -David Franzen
    Quality Engineer,
    Adobe Systems, Inc.

  • XMP metadata lost in PNG files

    Hello,
    My XMP metadata is lost from a PNG file if the file is modified and saved. Here is what I am doing
    1. Put some metadata in a PNG file using m_xmpFile.OpenFile( FileName, kXMP_PNGFile , kXMPFiles_OpenForUpdate)
    2. Edit this file in Photoshop (changed the brightness and contrast of the file)
    3. Saved the the modified files.
    All my XMP metadata is now lost fromt the file.
    is my implementation wrong? Is there some other way to stamp metadata in PNG files?
    Thanks,
    Hitesh

    Info: Mac, Yosemite, Bridge CC
    I have an extensive collection of PNG files that HAD been keyworded in Bridge (XMP). I noticed several days ago that the XMP of all those files is now missing.
    When attempting to assign keywords back in, I also get the message: "The file ####.png canot store XMP metadata. No changes will occur." Weird. Like you said, it's looking like a bug.
    And here's the kicker... if I duplicate the PNG file (Edit > Duplicate), the "copy" DOES contain the original XMP that went missing.
    I really don't want to have to manually duplicate all my PNG files just to regain the metadata. Any brainy solution? I'm attaching an example of the original PNG (missing XMP) and the duplicated PNG (magically restored XMP).

  • All methods to read xmp metadata  are not listed and described in documentation

    hi
    i have checked xapdumper example. it uses many methods which are not listed in documentation.
    also it is not able to read metadata from pdf files.
    can anyone tell me that what should i do to read metadata.
    i-e a brief explanation of steps i should follow to read metadata from a pdf file.
    thanks

    I have found that the XMP data of an InDesign document can be retrieved in actionscript as follows:
    InDesign.app.activeDocument.metadataPreferences
    This returns the MetadataPreference object.
    But I am not able to iterate each namespace in the xmp. There isn't any XMPFile class which allows me to serialize the object to xml file so that I can iterate all elements in the XMP.
    I could not relate class like XMPMeta, XMPProp, etc. with the MetaDataPreference class. So, how to obtain the entire xmp packet from the MetadataPreference object?
    Can anyone shed light on this?

  • How to read XMP metadata from a Jpeg

    This seems like it should be a no-brainer, but I can't find any classes to do this ?? I can find classes to read song titles from MP3 files, I want to do similar with jpeg image files.
    In photoshop and lightroom you can set up titles and captions (and copyright info) in the metadata. When you save a jpeg this gets embedded in the file.
    How to read this info and parse it and use it once you have loaded it into a BitMapData???
    I am Flash/AS3.0 code only no IDE -  please no flex/AIR examples!
    Thanks!

    http://www.adobe.com/devnet/xmp/

  • Option to store xmp metadata outside of DNG file

    This would serve to improve differential backups, as the xmp file format is text based and easy to tell differences.

    Walt,
    No, you totally misunderstood what I meant. I'm not talking about LR catalog backups, I'm talking about backing up scores of dng files completely outside of LR, from the OS or some other external tool. With my suggestion, the xmp file would be right next to its dng file, and i would be backing up the whole directory hierarchy that hold my files. One of the benefits of LR over Aperture is that I can access, manipulate, and/or backup my files outside of the app rather than having them locked up in a vault which must be backed up in one huge blob.
    If I change the brightness of 500 dng files using LR, then back up all my dng files using rsync (for example), I will be copying 500 large binary files around. If my edits were saved in separate text files (xmp), then my backup program could only copy the DIFF of each of the text files (one line added to each file, so one line, or five in a normal unified diff format, is all that needs copied around). This would be exponentially faster.
    Embedded xmp edits is not a good practice, from an OS-level backup point of view. Since not everyone will agree on that, I'm asking for a checkbox option - I'm fine with it being embedded by default.
    With xmp data being stored inside the dng file, and LR changing the dng file every time I edit something, LR is hardly non-destructive from an OS-level point of view when dng files are used.
    No where in the spec does it state that xmp changes data MUST be stored in the dng file. I'm simply asking for the option to store that data outside of the DNG file, so that the dng file only needs backed up once or rarely, rather than every time I make an edit.

  • Embedding extended XMP metadata into a PDF file

    Hello.
    I am preparing a thesis for submission into our library repository. They keep some additional information about the paper in a separate XML file which looks like: http://naca.central.cranfield.ac.uk/ethos-oai/2.0/uketd.xml
    The metadata can be then easily harvested by other libraries etc.
    Because the papers are downloadable and can freely circulate over the Internet I would like to also include the metadata into the PDF itself.
    I've managed to extend the PDFX (MiKTeX) package such that it writes custom metadata in addition to the default fields (Author, Title, Subject, Keywords) into the PDF.
    The problem is that the library metadata (see above) makes use of XSI schema which is apparently not compatible with RDF format of XMP.
    Is there a way to get such rich metadata sets into a PDF file in a portable and accessible (thinking about search engines) way or should I stick with plain Simple Dublin Core?
    Thanks for recommendations.

    You may want to repost this in the XMP SDK forum:  http://forums.adobe.com/community/design_development/xmp_sdk

  • Where do the XMP metadata templates and keywords files go WIN XP?

    I've just changed computers and upgraded to CS6. I am trying to import my Bridge metadata templates and keywords. I have the files from the old computer but I don't know where to put them on the new computer. The same folder structure where I found them (documents and settings/username/AppData/Adobe/BridgeCS5) does not exist on my new computer after installation of CS6. I tried pasting them in the program files folder for CS6, but this didn't work. I am using Windows XP. Thanks in advance.

    I tried pasting them in the program files folder for CS6, but this didn't work.
    Not familiair with Windows but on a Mac the path you show is still the same. Did you already used Bridge once?
    Quickest way I can think of is putting the files on your desktop and from Bridge metadata and keyword panel use the little menu icon top right of the panel and choose import settings. Find and select both settings and you should be OK.
    Also check this blog out, especially if you have subscribed to the cloud:
    http://blogs.adobe.com/jnack/2012/09/photoshop-windows-xp-end-of-the-line.html

  • Problem with Bridge CS4 reading/editing XMP metadata added in Bridge CS6

    Please excuse me if this is a dumb/obvious question. I did try searching the forums for similar problems and didn't find anything that seemed to speak to my issue.
    I'm having a problem where Bridge CS4 won't read/edit xmp metadata (specifically, keywords and descriptions in the IPTC panel) that I have entered using CS6. it will read some files, not others. The files are all .mp4s. Of these files, I can read/edit IPTC panel metadata for some of them in Bridge CS4; I can add metadata for all of them in CS6. I see no particular pattern in these files to explain what is and isn't read/editable in CS4.
    My question is whether this is a compatibility issue between different versions of CS (in this instance, CS4 and CS6). i know it's a tired refrain to blame software when it could easily be user error, in which case I'd be frankly delighted to know what i'm doing wrong. Please bear with me as I give a few more details.
    I'm using macs. I've tried this on multiple systems - for instance, on a mac pro 3 which for some reason has both CS4 and CS6 installed, i can add and edit keywords using CS6, but not when using CS4. Again, in CS4, some .mp4 files read/edit, others do not.
    Bridge CS4 blames the files and tells me that the selected file cannot store xmp metadata, and that the properties cannot be modified. To be specific, in the metadata panel it says "this property cannot be modified"; in the keyword panel, it says, "This file (zzz.mp4) cannot store xmp metadata. No changes will occur." This seems odd, because I'm able to add xmp metadata for the same files in CS6 on the same computer, and other computers. I know this problem would disappear if all our computers were using CS6 (or CC), but unfortunately that's not a possibility at the moment. Some of them only have CS4.
    Computer details (not an exhaustive list, but two instances): mac pro 3.1 running snow leopard, 16GB memory; macbook pro 4.1 running snow leopard, 4GB memory; adobe bridge cs6 (5.0.0.399) and cs4 (3.0.0.464).
    Things I have tried:
    Permissions - the files are set to read/write for everyone. Given that I can add/edit metadata in CS6, it doesn't seem to be a permission issue.
    Purging the cache - other users seem to have had problems adding metadata in Bridge CS4 where purging the cache for affected files solved the problem. Didn't work in this instance.
    Upgrading all affected computers to CS6/CC is beyond my control. I need to figure out why CS4 won't let me read/add/edit xmp metadata, if only for the sake of understanding the broader implications for interoperability.
    Any helpful suggestions would be much appreciated.
    Thanks,
    Kevin

    adobe bridge cs6 (5.0.0.399) and cs4 (3.0.0.464).
    Without having experience with mp4 files and metadata my observation is that you certainly have not updated Bridge CS6 ( should be 5.0.2.4) and I believe also not the latest version of CS4, can't imaging this also stayed at .0.0 so first try to update both.
    And if CS4 can read the data of some files it should be capable of reading them all. Be sure to have the files completely cached first, can take a while.
    Other things to try in CS4 is refresh preferences (hold down option key while restarting Bridge and choose reset prefs).
    And also check for hidden cache files using menu view/show hidden files. Sometimes those cache files can be troublesome between versions.
    If purge cache did not work and reset prefs also failed consider to also delete Bridge plist file and Bridge cache file manual (from user library)

  • How to read metadata from a pdf file

    hello
    i have got xmp sdk for windows.
    i want to read the metadata from a pdf file but i cannot
    find a way to do so.
    i cannot understand that which method to use to open the file whose metadata i want to read.
    if someone can tell me by an little code example then it would be great help.
    thanks

    The sample XAPDumper read metadata in a file (PDF or not) if it is valide. If you want to keep the XAPMeta object, don't delete this object in ProcessSubstring().

  • Editing XMP metadata in Bridge for checked-out files?

    Our custom connector does not implement the WRITE_XMP_METADATA Capability because we do not want to change the XMP of a file in our DAM system without checking in a new file version.
    However, when a file is checked out through Adobe Drive, we would expect to be able to edit its XMP metadata in Bridge just like we can for local files.
    It looks like this is still not possible with Adobe Drive 3, i.e. if your connector does not implement the WRITE_XMP_METADATA Capability you cannot edit XMP for checked out files either.
    It seems weird that you can edit XMP metadata for checked out files with regular CS applications but not with Bridge. Is this something that is expected to be fixed in a future version?
    Thanks

    In our design, editing XMP data in Bridge and in regular CS applications is different, the former one will be routed to SetXMPHandler in you connector, in the latter case, CS applications take the normal file writting ways to embed XMP data in the file content.
    The purpose of this design is to offer similar user experience for normal users when they edit XMP data for AD assets and local file assets, they don't need to check-out files first.
    To address your issue, I think you can add some codes in SetXMPHandler to auto check-out files before real XMP operation, and check-in them before exiting the handler
    We will consider to make some enhancements for this part, that's, to allow editng XMP data for the checked-out files in Br, in the next release, thanks for this advice.

  • C++ code to get XMP metadata from pdf files ??

    Hi,
    I am new to this field and now I have to write a C++ code which will read the XMP metadata from any pdf files. Could anyone please tell me how to do that or where to start? Is there any sample code available for that?
    I am reading the Programmer's guide and XMP specification to have the whole idea.
    I really appriciate your help. Thanks in advance.
    Regards,
    Suranjit Paul

    Hi,
    The same code for reading other formats will go for Pdf too.
    Only difference is while reading PDF it is not calling any smart filters.

Maybe you are looking for

  • Upload data from excel to application server

    Hi all, Is there any process to upload data from excel to application server other than reading the data from excel to z program through gui_upload and transferring the data to application server. I want to run background job for a BDC program with t

  • JavaMail, ESMTP, problem with this server response: "+  stunnel"

    I need to send message through a STMP server I don't know much about. The server works fine, when using port 25. But I need to send mail through port 465. I've looked around the web, I've searched the forums, but found no solution. I've identified, t

  • All the columns of an alv grid report are not downloading in excel in 1 lin

    Hi All, I have some 60 columns in my alv grid report and user can download the report using list->export->localfile->spreadsheet. What the issue is that all the columns are not downloading in one line, instead they split in two rows. Please help. Reg

  • Get to know which one is active Stroke or Fill for the document.

    Is there any way to find out which one, between stroke or fill, is active for a particular document using illustrator scripting? I have to apply color on the selected object accordingly. If fill is active then i use obj.fill.color = 0xff00ff; and, if

  • Install Oracle10gR2 on mandriva 2005 (10.0)

    Hello, somebody can it give me the version of the libraries db1 binutils make blibc openmotif make gcc glic to install for oracle10gR2 on linux mandriva 10.0 Thank yon Alain [email protected]