quick read

Started by jean, December 06, 2011, 05:31:01 AM

Previous topic - Next topic

jean

Hello
Is there a way to know quickly if a file has EXIF, IPTC, XMP ?
I would like to know if these metadata are in the file, without really reading them.
jean

Phil Harvey

Hi Jean,

You can do quick and dirty tests by using grep to search for patterns in files to determine if a file may contain these types of metadata.  But to tell for sure you really need to parse the file structure properly.

In both cases, of course, you are actually reading the file.  To do so without reading it would require a good fortune teller.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jean

Hi Phil

Thank you, i will try using the program kept in memory, it should be fast

Alan Clifford

Just guessing here, but the words "without reading" might mean "without seeing" the meta data.  So something like

exiftool -G dsc_5486.jpg | grep -i xmp > /dev/null; echo $?

would give a 1 or a 0 result.


Alan


Phil Harvey

#4
Quote from: Alan Clifford on December 07, 2011, 06:55:19 PM
Just guessing here, but the words "without reading" might mean "without seeing" the meta data.  So something like

exiftool -G dsc_5486.jpg | grep -i xmp > /dev/null; echo $?

would give a 1 or a 0 result.

Here is a way to do this a bit more easily:

exiftool -p '$xmp:all' image.jpg

This command returns 1 if XMP exists, or 0 if it doesn't.  (Note: Use double quotes instead of single quotes if you are in Windows)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).