exiftool will not work using php exec($cmd, $output) when dir is on CD

Started by pizzipie, July 13, 2023, 10:36:31 PM

Previous topic - Next topic

pizzipie

Hi,


When using using PHP and the source dir is on media(DVD) I can't get exiftool to work.


$cmd='exiftool -s -@ ./myargs.txt -json /media/rick/PollyPics/Pictures-Vista/March8_2005/*';

exec($cmd, $output);

echo "out ". gettype($output);

myprint($output);

out array

Array
(                <============= NOTHING HERE
)

I have to send the output of exiftool  run on the browser to a json file on my hard drive (pic.txt) first and then I can  manipulate the exiftool output with PHP.


 exiftool -s -json -@ /home/rick/DBases/Dbmysql/experiment/exiftools_php/myargs.txt /media/rick/PollyPics/Pictures-Vista/March8_2005/ > /home/rick/Desktop/PollyPics/pic.txt

    1 directories scanned
    4 image files read
[/tt]

Help with this is greatly appreciated. I am very in-experienced using exiftool so please be detailed (ie: basic details are needed.)

Thanks, R

StarGeek

What is the contents of myargs.txt?

Exiftool should at least output a json with "SourceFile" entry unless it is unable to execute properly.

What is the result if you add result_code variable?

exec($cmd, $output,$rc);
echo $rc;
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

You should make sure your command works at the command line and figure out any problems there before trying to run it from PHP.

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