Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: prob with exec, exiftool and one photo Date: Tue, 13 Dec 2016 23:42:03 +0100 Lines: 53 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net FJUb1VNGdG/3gUP9riptBAUckO1ivg5rT0hV6kaZQgQC33lDUD Cancel-Lock: sha1:iqhTmpbjl2XRRZbOFURYFoOa4l8= X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: Xref: csiph.com comp.lang.php:17206 On 12/13/2016 05:14 PM, Une Bévue wrote: > i need to read exif infos from those files using the php script : > > $EXIFTOOL = '/usr/local/bin/exiftool'; > $cmd = "$EXIFTOOL " . $data['PATH']; > exec($cmd, $Infos, $ExitStatus); > foreach($Infos as $line) { > $fields = explode(' : ', $line, 2 ); > if(count($fields) == 2) { > $data[rtrim($fields[0])] = $fields[1]; > } > } > $data['ExitStatus'] = $ExitStatus; > > for 3 of those photos : > Cirques.jpg > Cirques.png > IMG_3130.JPG > > i get back the good exif infos, like : > { > "ExifTool Version Number": "10.20", > "File Name": "IMG_3130.JPG", > "Directory": "\/Users\/yt\/Sites\/tests\/Flipping_image\/photos", > "File Size": "541 kB", > [...] > "Hyperfocal Distance": "1.82 m", > "Light Value": "4.0", > "ExitStatus": 0 > } > > however for the photo '20161202_085945.jpg' the php script returns > nothing even no error What's the exit status code? Have you verified that the path is correct? Is it a full path or a relative path (in this case it may not be relative to the script executed first)? If your script takes all the files in the directory, but always missing one file, then your outer loop has issues, as you haven't provided how you get your $data in the first place, it's just a guessing game for us who ain't mind readers. -- //Aho