Author Topic: Is ExifTool supposed to be working from a PHP script without -php and eval()?  (Read 2796 times)

machouinard

  • Newbie
  • *
  • Posts: 9
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
Code: [Select]
$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
« Last Edit: March 01, 2012, 04:31:19 PM by machouinard »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).