Is ExifTool supposed to be working from a PHP script without -php and eval()?

Started by machouinard, March 01, 2012, 03:41:17 PM

Previous topic - Next topic

machouinard

Okay, Newbie forum, newbie question.

I was under the impression that with the addition of -php I'd be able grab an array of EXIF data in a PHP script.  That seems to be working fine, but just for the hell of it I tried

$exif = `exiftool  -h -g $image`;

and that works just fine, too.  Gives me a nice formatted table to plug into my site.  Is it supposed to work this way?  I've been using PHP for several months now but this is my first experience with PERL.  I'm not looking for a tutorial or anything (although that could help clear up some other questions).  Just want to know what I should expect to be happening.

Using:
ExifTool 8.77
PHP 5.3.10

HostGator Shared Linux Hosting

Thanks,
Mark

Phil Harvey

Hi Mark,

The exiftool application interacts with PHP just like any other command-line application.  The -php option only provides an output that is formatted as a PHP array, but you may capture any of the output formats that you like as you have done with the -h output.

- 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 ($).