Writing XMP Thumbnail Metadata to AE Preset

Hi guys.
I am working on a After Effects script to basically insert a gif as metadata into a fx preset file. If you open Adobe bridge and browse to the After effects text presets you will see that you can click on a preset and in the preview there is an animated GIF. So I am attempting to do this for custom presets.
Basically I think I need to read the contents of a GIF file as data, or text, then encode that as base64 and insert it into the metadata of the preset file.
I have a come across a couple of problems though:
1) I can't seem to read in the GIF file as data
     The code I am using is:
file = new File("C:\\test.gif");
file.open("r");
test = file.read();
alert(test);
And all I get returned is the first part of the data which is "GIF89aØ", It seems that when white space is encountered After Effects stops reading the data.
2) I have been testing some code to write thumbnail data to a preset file, but I have come across an issue here too.
if (ExternalObject.AdobeXMPScript == undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
file = new File("C:\\joshPreset.ffx");
xmpFile = new XMPFile(file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var xmp = xmpFile.getXMP();
xmp.appendArrayItem( "http://ns.adobe.com/xap/1.0/","Thumbnails",null, 0,XMPConst.ARRAY_IS_ALTERNATIVE );
This code works, it inserts a Thumbnails array into the metadata, which looks like this:
   <xmp:Thumbnails>
    <rdf:Alt>
    </rdf:Alt>
   </xmp:Thumbnails>
I then need to add other properties within the Thumbnails array like xapGImg:height and xapGImg:image
So from what I read in the documentation I need to add a Struct field?
I add these lines to my code:
XMPMeta.registerNamespace("http://ns.adobe.com/xap/1.0/g/img/", "xapGImg");
xmp.setStructField("xapGImg","Thumbnails","xapGImg:height", 0,null );
The first line is to register the name space. xapGImg is what I found in the after effects text preset file.
The second line is to add a struct field to the array. But I get an error whenever I run it with the second line. It says:
XMP Exception: Unregistered schema namespace URI
I have tried all different combinations of the namespace in the second line but just cannot get it to work!
If anyone can help that would be great!

Hi AthorNZ,
I can only give you some answers regarding question 2.
First of all you should be aware that XMPFiles does not offer smart handling of AE project files. Instead it uses so called "packet scanning" to work with the XMP within the file. This means that reading of XMP data works fairly well but updating it is rather limited. If no XMP is present in the file, it cannot be newly injected. If XMP is present, it can only be updated within the given space (i.e. padding) that already exists within the file. Otherwise an update is rejected.
Regarding the thumbnails: Your first snippet of code is correct. But for one you do not need to register the thumbnail related namespace as it is a pre-registered one. So you can use the constants from XMP_Const.h to work with those namespaces.
Secondly to set a struct field within the array you need to use the namespace URIs and not prefixes. Again you can use constants already defined:
xmp.setStructField( kXMP_NS_XMP, "Thumbnails", kXMP_NS_XMP_Image, "height", <your value> );
You got the exception because XMPCore tried to interpret your prefixes as URIs which were not registered, of course.
Kind regards
Jörg
Adobe XMP

Similar Messages

  • Writing XMP Thumbnail Metadata to AE Preset (Scripting)

    Hi guys.
    I am working on a script to basically insert a gif as metadata into a fx preset file. If you open Adobe bridge and browse to the After effects text presets you will see that you can click on a preset and in the preview there is an animated GIF. So I am attempting to do this for custom presets.
    Basically I think I need to read the contents of a GIF file as data, or text, then encode that as base64 and insert it into the metadata of the preset file.
    I have a come across a couple of problems though:
    1) I can't seem to read in the GIF file as data
         The code I am using is:
    file = new File("C:\\test.gif");
    file.open("r");
    test = file.read();
    alert(test);
    And all I get returned is the first part of the data which is "GIF89aØ", It seems that when white space is encountered After Effects stops reading the data.
    2) I have been testing some code to write thumbnail data to a preset file, but I have come across an issue here too.
    if (ExternalObject.AdobeXMPScript == undefined) {
    ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
    xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
    file = new File("C:\\joshPreset.ffx");
    xmpFile = new XMPFile(file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
    var xmp = xmpFile.getXMP();
    xmp.appendArrayItem( "http://ns.adobe.com/xap/1.0/","Thumbnails",null, 0,XMPConst.ARRAY_IS_ALTERNATIVE );
    This code works, it inserts a Thumbnails array into the metadata, which looks like this:
       <xmp:Thumbnails>
        <rdf:Alt>
        </rdf:Alt>
       </xmp:Thumbnails>
    I then need to add other properties within the Thumbnails array like xapGImg:height and xapGImg:image
    So from what I read in the documentation I need to add a Struct field?
    I add these lines to my code:
    XMPMeta.registerNamespace("http://ns.adobe.com/xap/1.0/g/img/", "xapGImg");
    xmp.setStructField("xapGImg","Thumbnails","xapGImg:height", 0,null );
    The first line is to register the name space. xapGImg is what I found in the after effects text preset file.
    The second line is to add a struct field to the array. But I get an error whenever I run it with the second line. It says:
    XMP Exception: Unregistered schema namespace URI
    I have tried all different combinations of the namespace in the second line but just cannot get it to work!
    If anyone can help that would be great!

    This question is cross-posted on the XMP SDK forum:
    http://forums.adobe.com/thread/572055

  • Error writing XMP metadata

    I'm running version 1.4.1 under Vista Home Premium. I have imported several hundred jpegs from my HDD and some of these have a downward arrow at the top right of the thumbnail in Library view. On clicking this, a dialog tells me the metadata has changed in Lightroom and I need to save the changes to disk. On clicking "save"I get an error dialog stating "'Writing XMP metadata' did not complete successfully". I've also tried selecting a whole folder of jpegs, or a batch selected by Keyword, and updating them all at once using the "Metadata - Save metadata to files" menu option, but more often than not there are some photos in the batch that will not write the metadata successfully. I have been unable to detect any pattern to the images "chosen" for rejection. I think they are all pictures that were originally scanned from prints, but so were many others that update successfully. The metadata I am trying to update on them consists of Keywords and Capture dates.
    Can anyone suggest how I might get these files to update?

    I posted a similar query a little while ago, and judging from the response this was not widespread so I reasoned it was something peculiar to my catalogue.
    After extensive testing of my set-up I could find nothing - indeed the XMP data APPEARED to be written fine to the XMP segment of the jpegs, etc. and to the XMP sidecar files for the RAW images - just Lightroom was sure it wasn't OK.
    To cut a long story short, I found that I had a spurious and invisible control character in one of my metadata fields. I guess I inserted this character when I was fumbling round the keyboard trying to find the correct key combination for the '©' (copyright) character. Unfortunately I did this when setting my standard metadata template I use on all imports!
    When Lightroom writes the XMP data it doesn't write this control character, however the character exists (invisibly to the Lightroom user) in the catalogue database. As a result the file-based and database versions will never match - with manual or automatic syncing - so you (nearly) always get the 'File Metadata needs updating' arrow icon.
    To check this out you need to choose an image and remove metadata one field at a time - trying the save between each change. When it saves OK then you have found your culprit and can sort out the rest of the images.
    Strictly speaking this is a bug. The interface should show all characters in the database and shouldn't store in the database anything that is invisible in the GUI...

  • "Writing XMP Metadata Did Not Complete Successfully" Issue

    Hi all,
    I've been using Lightroom for a bit now. I'm on V2.5 now.  I just did a new system build and so reinstalled Win Vista 32.  My photos and XMP files are on a seperate external drive and I saved my catalog file (plus did a backup).  When I reinstall Lightroom and did the updates I then copied the old catalog 2 file to the right location.  All my pics were there with edits no problem.  I've done this several times now when I have had to reinstall the OS for various reasons. Never had an isuse
    This time I went back to change some status data on a photo that I took before the reinstall.  When I went to update the metadata I get a message that says "Writing XMP Metadata Did Not Complete Successfully".  I looked in Bridge and the data did not update.  This happens for all my RAW photos that were taken before the reinstall.  I can make changes fine but cannot get the XMP to write.
    Bridge will not make changes either. I tried changing the star rating and color label and it does nothing.
    For files that I have imported after the reinstall it all works fine.
    It is like the old XMPs are locked or the programs can't find them.  I can see them in the file manager so they are all there.
    Any ideas on the problem and how to fix it?

    I don't think they are locked.  I think Vista is just blocking Lightroom.  I went back this morning and deleted a few of the xmp's as you suggested and Lightroom worked fine and wrote the files.  Then I thought about the potential lock issue and tried opening Lightroom "As an administrator".   When I did that everything worked fine.  For some reason Vista won't let lightroom open the older files unless it sees it as the admin.  All works fine now.  Thanks!!
    Glenn

  • Resolving " Writing XMP Metadata did not complete successfully " Errors

    On certain files, when I try to save the metadata, I get this error - Writing XMP Metadata did not complete successfully
    Does anybody know why and how to resolve the issue?
    Thank you.

    Check if your files are write protected! For RAW files, the xmp sidecar file must not be write protected. For JPG and other non-RAW files, the image file itself must not be write protected.

  • Writing XMP to multiple file formats (PDF, JPEG,  TIFF, etc)

    Hi,
    I am developing a server-side component that embeds XMP data into a file (of various formats) and then provides these files for client download.
    I have been using the XMP toolkit for generating the metadata, however i now have the problem of getting this metadata into the relevant file. I could always develop this myself but it seems like a huge amount of work. So to make my life easier, does anyone know of any toolkits (from adobe or otherwise) that support writing XMP data into different file formats (PDF, JPEG, TIFF, AIFF, MPEG etc) ??
    I am developing in Java so I would prefer Java libraries, however I can always use JNI calls to C/C++ (as i have with the XMP toolkit).
    Any help would be very appreciated.
    Regards,
    Jude

    Greetings,
    I think we should standardize some information, I know for a fack, that I will support adding XMP metadata in the HDF, RIFF, IFF and OLE file formats. If you have any specific suggestions on the chunk information or signature information that I should use, let me know?
    For my part, I was thinking of adding RIFF,IFF chunks with the name \ xmp in those file formats. For OLE, maybe an added stream with the xmp name (in UTF-16).
    Comments welcome everyone!

  • Possible to generate xmp thumbnails for PDF files in Acrobat?

    Hi,
    Apps from the Creative Suite 5.5 allow to embed a tiny preview (as XMP thumbnail) when saving to some .ai .indd or .pdf file. However, I could not find the option in Acrobat X Pro.
    Such XMP thumbnails prove useful when visually browsing through PDF documents in Windows' explorer. I'm surprised Acrobat X lacks such a feature whereas other apps from the Suite do it fine.
    Please not I'm not talking about embedding page previews, this is a completely different topic.

    sample file, you can use any name and append the xml data elements too...
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type ="bursting">
    <xapi:request select="/MODULE1/LIST_G_EMPNO/G_EMPNO">
    <xapi:delivery>
    <xapi:email id ="123" server="[email protected]" port="25"
    from="[email protected]" reply-to="[email protected]">
    <xapi:message id="123" to="[email protected]" cc="" attachment="true"
    content-type="text/html" subject="Purchase Order Number: ${EMPNO}">Please
    see attached Purchase Order File: ${EMPNO}</xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output="PO_${EMPNO}" output-type="pdf" delivery="123">
    <xapi:template type="rtf" location="xdo://CUS.TEST_BURST_1.en.US/?getSource=true"
    filter=""></xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    Edited by: Sattti on Nov 2, 2008 8:26 PM

  • How to hide xmp thumbnail images?

    Is there a way to hide all of the xmp thumbnail images that appear next to the photo image thumbnails? It makes it harder to browse. Thanks!!

    What are you talking about? What version? Have you properly set the View menu not to show hidden or invisible files?

  • Bridge Thumbnail Metadata doesn't show dates consistently

    I tried changing my Thumbnail preferences in Bridge to add Additional Lines of Thumbnail Metadata.
    I checked show Date Modified.
    However, not all pictures were giving the same data.
    I.e. some show Jan 13 and others 1-1-2013.
    How can I change this so it's just Jan 13 or 1-1-2013 and not both?

    When you set up the download you can specify what style of date you want.  Not sure how you change once in system.

  • [JS][CS5] - Save XMP thumbnails by artboard?

    Is it possible to save illustrator XMP thumbnail previews by artboard? It seems like Illustrator saves a single thumbnail with all art regardless of the number of artboards.
    Does anyone know if there is a property that can be set to save multiple thumbnails to the XMP packet by artboard when saving to a native Illustrator file?

    Sorry I've not actually looked that far yet… I know that ID has the preference to do this as I use it. But AI has not, it may be possible to add custom XMP to include this and that has been on my to do list for a while… What is using this XMP?

  • TRouble getting LR4 to open; writing xmp

    I'm having trouble getting LR4 to open.  IT says it is "loading."  I had to force quit the last time I used it because it said it was busy still writing xmp data.  Any suggestions?

    Mylenium answered:
    "You need to install the 11.0.4 update for AE. Run the updater or download it manually."
    --this worked.  Thank you

  • Best practice in writing xmp metadata?

    I know to switch off the 'automatically write to xmp metadata' feature. But, after doing this, what is the best way to ensure the xmp metadata does actually stay up to date?
    My understanding is that by switching the automatic writing back on, LR goes through the whole catalogue, comparing the data in its database with the data in the xmp files, and every time it finds something different, it copies from the database to the xmp. However, there would seem to be two problems with this. i) it's extremely slow, because it's such a big job, and (b) presumably any changes made elsewhere, eg in ACR, will be overwritten.
    The alternative seems to be to right click on the folder while in library mode and select "save metadata". However, for some unknown reason, this is unbelievably slow. What prompted me to write this message is that nearly an hour ago, I did this with a folder of 78 files, and it's still churning away. In that time, I've had time to log on to this forum, read a few messages, do a search to see if there is anything helpful, and then write and edit this. I don't dare try this with the folders I have with three hundred photos in!
    The LR catalogue is in a partition with hardly anything else in it, on a different physical drive from LR itself. It gets defragged more frequently than the defrag utility thinks it needs to be. During metadata writing and many other operations, the CPU maxes out at 100% yet only about 75% of my 1GB memory is used.
    Is there anything I can do?
    I'm on an old-ish PC and am not in a position to upgrade (please - any messages just saying I need a newer computer are not going to be any help :-) ). Any other help would be appreciated.

    Thanks, Mel. You just posted as I was writing the previous message!
    I think you nailed it. The 78 pictures, I did by right-clicking on the folder name in the right-hand fly-out panel in library and selecting 'save metadata' (hope the choice of words here is clear!). I've just tried the ctrl-a, ctrl-s technique you describe, and it whizzed through a folder of 127 photos in no time.
    So, you're right - there appears to be a bug.
    One more problem - there was an error in saving to the tifs in the folder. A separate problem which I'll look at tomorrow.
    Back to the other part of my original question. What is the most efficient way to keep the xmp data up-to-date? Considering that there's massive scope for human error in having to remember to save manually all the time, this can't, surely, be the best way to do it. What do people generally do, and has anyone evolved a 'best practice'?

  • Writing XMP Metadata did not complete successfully

    The subject line is the message Lightroom 1.3 (trial version installed today) under Windows XP gave me after selecting 102 Photoshop .psd files and trying to 'Save Metadata to Files' with <Ctrl-S>.  Fifty-two of the 102 files failed to update. The directory where these are stored (no files other than the .psd files) now has a bunch of files named 'filename.psd.swp', which are the ones that failed to update the metadata.<br /><br />All of the subject files, as well as the ones that updated successfully, are layered Photoshop files created in October 2004 with whatever version of Photoshop (CS?) was current at that time.  I'm going back and adding IPTC core contact info, as well as locations and 'Date Created' when that was missing.<br /><br />If I open the problem files in Photoshop CS3, make an invisible change and resave them then Lightroom will successfully update the metadata.  But that's a very tedious chore.  The .psd files are anywhere from 15K to 250K in size.  There's no pattern in the file sizes to the ones that failed to update.<br /><br />I've been doing this in Bridge CS3, but got tired of waiting for files to write.  They're on a Buffalo Terrastation on my network.  Lightroom seemed worth a try, editing the metadata in its internal database and then writing the updates to the original files in bulk while I sleep.  But this doesn't appear to be reliable.<br /><br />I didn't fine anything in Help, the Knowledge Base, nor this Forum that provided any clues.<br /><br />Any ideas?<br /><br />Thanks,<br /><br />-- Mark Turner

    I don't think they are locked.  I think Vista is just blocking Lightroom.  I went back this morning and deleted a few of the xmp's as you suggested and Lightroom worked fine and wrote the files.  Then I thought about the potential lock issue and tried opening Lightroom "As an administrator".   When I did that everything worked fine.  For some reason Vista won't let lightroom open the older files unless it sees it as the admin.  All works fine now.  Thanks!!
    Glenn

  • What's the reason for " 'Writing XMP Metadata' did not complete successfully

    I rightclicked an image and selected "save metadata to file" and got this not-so-very-informative error message. What could be the cause? The file is there and it is not write protected.
    Adobe - what about giving some more information when LR encounters errors?
    Win XP, LR 1.3.1

    While read only is the most likely cause, I have been trying to track down a similar problem which so far I can only equate to the creation time of the file ending in 00.
    For example, I have a file taken at 6/13/2006 1:00:00 PM
    If I do Metadata -> Edit Capture Time...
      and set the time to be 6/13/2006 1:00:01 PM
    Then click twice on the Resolve Conflicts button for Metadata, the second one works.  Both times I tell it to overwrite the metadata on disk.  My assumption is that the data processing logic has issues reading in entries like:
       2006-06-13T13:00:00-08:00
    I would even go so far as speculating it treats them as just the day and drops the hour / minute portion.  The reason for this conjecture is that I stumbled on this issue when exporting images would occasionally have 2006/06/13 12:00AM as the timestamp and when I checked which ones had problems, they all were taken at 00 seconds into the minute.
    Henrik, if you are still having this problem, does the file happen to have a 00 second creation timestamp?  If so, try changing it by a second and I would be curious if you it starts working for you too.
    Cheers,
    John

  • Accessing a Thumbnails metadata

    With Photoshop, activeDocument.xmpMetadata.rawData will give me a string that contains an images metadata. From that I can extract what I want.
    Is there a way of achieving something similar with Bridge.
    Ideally I would like the same again, a string containing everything. If that is impossible perhaps a series of strings for each namespace?
    And, a way of reading those namespaces without knowing what they are in advance?
    I can see ImportCamera is doing something along these lines (for example - in the rename dialog it seems to be generating the dropdown metadata namespace list eg IPTC, or EXIF on the fly - at least I can't find the source text 'IPTC').
    It would be very helpful to have a direct way of obtaining all of an images xmp metadata without having to make specific requests as to namespace and identifier and without having to open the image in PS.
    Andrew

    Sorry, there isn't such a beast in Bridge...
    Meanwhile, check out AdobeLibrary3.jsx, I wrote something to try to at least put a band-aid on this problem.
    MdNs.MdManager
    Create one for each thumbnail -
    var mdm = MdNs.MdManager( thumb );
    mdm.grab();
    will grab all the values from the standard schemas.
    MdNs.MdManager.loadMetadata() will load the metadata for each thumbnail selected in bridge. After it's run, each thumbnail will have an "mdManager" property pointing to it manager.
    Then all the normal namespaces are defined further down. You can use those to do all kinds of things.
    In the version you have, you won't have the Camera Raw metadata. To add those paste this code in:
    new MdNs.MetadataNamespace( "Camera Raw Settings", "http://ns.adobe.com/camera-raw-settings/1.0/", "crs" );
    new MdNs.MdElement( "Camera Raw Settings", "Version", true );
    new MdNs.MdElement( "Camera Raw Settings", "WhiteBalance", true );
    new MdNs.MdElement( "Camera Raw Settings", "Temperature", true );
    new MdNs.MdElement( "Camera Raw Settings", "Tint", true );
    new MdNs.MdElement( "Camera Raw Settings", "Exposure", true );
    new MdNs.MdElement( "Camera Raw Settings", "AutoShadows", true );
    new MdNs.MdElement( "Camera Raw Settings", "Shadows", true );
    new MdNs.MdElement( "Camera Raw Settings", "Brightness", true );
    new MdNs.MdElement( "Camera Raw Settings", "Contrast", true );
    new MdNs.MdElement( "Camera Raw Settings", "Saturation", true );
    new MdNs.MdElement( "Camera Raw Settings", "Sharpness", true );
    new MdNs.MdElement( "Camera Raw Settings", "LuminanceSmoothing", true );
    new MdNs.MdElement( "Camera Raw Settings", "ColorNoiseReduction", true );
    new MdNs.MdElement( "Camera Raw Settings", "ChromaticAberrationR", true );
    new MdNs.MdElement( "Camera Raw Settings", "ChromaticAberrationB", true );
    new MdNs.MdElement( "Camera Raw Settings", "VignetteAmount", true );
    new MdNs.MdElement( "Camera Raw Settings", "ShadowTint", true );
    new MdNs.MdElement( "Camera Raw Settings", "RedHue", true );
    new MdNs.MdElement( "Camera Raw Settings", "RedSaturation", true );
    new MdNs.MdElement( "Camera Raw Settings", "GreenHue", true );
    new MdNs.MdElement( "Camera Raw Settings", "GreenSaturation", true );
    new MdNs.MdElement( "Camera Raw Settings", "BlueHue", true );
    new MdNs.MdElement( "Camera Raw Settings", "BlueSaturation", true );
    new MdNs.MdElement( "Camera Raw Settings", "ToneCurveName", true );
    new MdNs.MdElement( "Camera Raw Settings", "CameraProfile", true );
    new MdNs.MdElement( "Camera Raw Settings", "HasSettings", true );
    new MdNs.MdElement( "Camera Raw Settings", "HasCrop", true );
    new MdNs.MdElement( "Camera Raw Settings", "RawFileName", true );
    Hope it helps.
    Bob
    Adobe Workflow Scripting

Maybe you are looking for

  • How to get photos from Photo Library, an album on iPhone, into iPhoto on desktop mac

    Hi, this would seem simple, but somehow it's not. I have ~1500 photos on my iPhone in a separate album. They were synced previously with an iTunes library, that I have now lost for good. The images are still on my iPhone and I want to transfer them t

  • Email notification from workflow?

    Dear all, I am using EBS version is 11.5.8 and database version is 9.2.0.3. We are using workflow to send out email notification once the PO gets approve. Now, we are going to change SMTPServerName(email server IP) let say from '123.45.66.10' to '999

  • TsMuxeR and Hybrid on OSX Mountain Lion

    Does anyone know if tsMuxeR works on OSX Mountain Lion? Also, what about Hybrid and OSX Mountain Lion? Thanks.

  • Application hangs in STOPPING status - NW04s

    Occassionally, when manually stopping an application from the deploy service inside of Visual Administrator, the application stays in a STOPPING status.  The only way that we have been able to get it out of this STOPPING status is to restart the enti

  • IPhone 5 Preorder confirmation email

    Hey everyone so I Preordered the iPhone 5 last night though the apple website. I received an email saying my order is being processed at 3:16am est but have yet to receive a confirmation email as of now (1:40pm est). I called apple and they were unab