0

I`m trying to create a page that read the metadata of an image and allow user to edit it and save it to the same image.

After searching the internet I have found exiftool as the solution but I can make it work only as a command line not as a library in the page.

I have this code: eval('$metadata=' . exiftool.exe -php -q $imagePath); foreach ($metadata[0] as $key => $value) { if ($metadata[0][$key]!=$_POST[$key]){ if ($_POST[$key]=="") $_POST[$key]=" "; //if metadata is not set, than create an empty metadata eval('$metadata=' . exiftool.exe "-$key=$_POST[$key]" $imagePath); } }

and I`m getting this error:

Parse error: syntax error, unexpected 'image' (T_STRING) in E:\xampp\htdocs\imgdata\index.php(30) : eval()'d code on line 1

I tried to replace the ` with other like " and ' but no luck. What do I miss? Any better idea on how to do it?

Thanks

R.K
  • 19
  • 3

1 Answers1

0

I had the same problem, but using Centos OS, and found a solution here:

'command not found' error when using subprocess in apache

Might not work for Windows but worth a look. Basically the answer suggests specifying the full exiftool path rather than simply exiftool.exe.

If that doesn't help then have a look for errors in the Apache Error Log File.

Community
  • 1
  • 1
DavidSinclair
  • 91
  • 1
  • 3