Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Read exif/xmp data from photo

  • Read exif/xmp data from photo

    Posted by Robert Rodick on October 17, 2010 at 3:43 pm

    I’m creating a viewfinder effect with text layers displaying ‘exposure time’, ‘ISO-speed’ etc.

    Is it possible to read this from the imported photo’s (exif/xmp) and automatically change the text based on the values ?

    Tim Smith replied 11 years, 1 month ago 4 Members · 6 Replies
  • 6 Replies
  • Chris Wright

    October 17, 2010 at 6:52 pm

    unless you want to go crazy and program the code yourself, I’d recommend simply taking the data from a command line tool already finished.

    exiftool(-k).exe
    https://www.sno.phy.queensu.ca/~phil/exiftool/

    adobe has their xmp sdk download with sample code too.
    https://metadatadeluxe.pbworks.com/Adobe-XMP

    if you do want to go crazy, here’s some prebuilt libraries with examples
    https://www.codeproject.com/KB/graphics/exifextractor.aspx
    https://www.drewnoakes.com/code/exif/sampleUsage.html
    https://borys.name/blog/extract_xmp_tags_from_jpeg_in_java.html

    https://technicolorsoftware.hostzi.com/

  • Dan Ebberts

    October 17, 2010 at 7:39 pm

    You can’t do it with an expression, but you could do it with a script. It can be tricky navigating XMP data, but it would look something like this:


    {
    if (ExternalObject.AdobeXMPScript == undefined) {
    ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); }
    var metaFile = File.openDialog("Select file to import.");
    var xmpFile = new XMPFile( metaFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
    var xmp = xmpFile.getXMP();
    var myExposureTime = xmp.getProperty(XMPConst.NS_EXIF, "ExposureTime");
    var myISO = xmp.getArrayItem(XMPConst.NS_EXIF, "ISOSpeedRatings", 1);
    alert("exposureTime: " + myExposureTime.toString() + " ISO: " + myISO.toString());
    xmpFile.closeFile();
    metaFile.close();
    }

    Dan

  • Chris Wright

    October 17, 2010 at 8:33 pm

    I hope you guys get that working. In the meantime, I tried this and it works perfect. The script writes to a text file that AE can import as text in a simple script.

    exiftool -T -iso c:ab.jpg > out.txt”)

    https://technicolorsoftware.hostzi.com/

  • Robert Rodick

    October 23, 2010 at 2:51 pm

    Sorry for the late reaction. But thank you for the script.

  • Chris Wright

    November 8, 2010 at 6:20 am

    Does this work in some fashion? I tried the bare minimum and it didn’t work. and adobe.com said they don’t support this feature, unless I misunderstood.

    https://technicolorsoftware.hostzi.com/

  • Tim Smith

    August 3, 2015 at 6:28 am

    Hi Dan,

    Curious if you know how, if it’s at all possible, to dump all the namespace URI’s contained in a files meta data?

    Seem to be having problems accessing certain namespace’s properties that I know exist.

    ….or if you know of the limitations to AE’s ability to access this information?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy