ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: jean on December 06, 2011, 05:31:01 AM

Title: quick read
Post by: jean on December 06, 2011, 05:31:01 AM
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
Title: Re: quick read
Post by: Phil Harvey on December 06, 2011, 08:33:23 AM
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
Title: Re: quick read
Post by: jean on December 06, 2011, 10:40:11 AM
Hi Phil

Thank you, i will try using the program kept in memory, it should be fast
Title: Re: quick read
Post by: 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.


Alan

Title: Re: quick read
Post by: Phil Harvey on December 08, 2011, 07:19:15 AM
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