Data from files on Disk

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

ValHallen

Data from files on Disk

Post by ValHallen »

This has probably been addressed before, if so, please point me in the right direction? I have found some stuff on here (png info, jpg info) that does what I am looking for, but nothing really that grabs it from anything.

Here's my question.
In Photoshop, is it possible to read dimensions and thumbnails from files on disk, without opening them? I have systems to do it if not, would just be a buttload more elegant if I could just read the file data into a script for display. I want to be able to do this on ANY file type, but most often PSD & PNG.

Like I said, I have probably missed the answer on the forums, but thought I would ask anyways.

Thanks in advance.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Data from files on Disk

Post by Mike Hale »

You can get metadata from a file without opening it by either using the XMPLibrary and XMPFile or by sending a BridgeTalk message to Bridge and have Bridge get the info.

There should be plenty of examples here using both methods. Let us know if you need additional help.
ValHallen

Data from files on Disk

Post by ValHallen »

So from what I have read, XMP requires saving or have saved an XMP file to disk? And bridgetalk means opening Bridge? So lost right now
larsen67

Data from files on Disk

Post by larsen67 »

What OS are you using… If you are on a mac then you can have spotlight get the metadata…
ValHallen

Data from files on Disk

Post by ValHallen »

Windows Combination (XP,7)
Mike Hale

Data from files on Disk

Post by Mike Hale »

ValHallen wrote:So from what I have read, XMP requires saving or have saved an XMP file to disk? And bridgetalk means opening Bridge? So lost right now
Using the XMPLibrary requires both a version of Photoshop that supports the lib( it is not supported in older versions ) and that the file being read has xmp metadata either as part of the file or in a sidecar xmp. So that approach is only useful if the files were saved by an Adobe product and can support metadata.

The Bridge approach can create the need xmp data on the fly, works with older version of Photoshop, and with file formats that don't support stored metadata or those that were saved without metadata( such as SFW jpegs ). But it does require Bridge so it needs to either be running or stated before sending the Bridgetalk message.

There are other approaches you could try. For example you could create a command line file that calls ExifTools to read the data and write it to a file. Then read the file.

As a last resort you could create custom file parsers for each format you need to extract the data from.