Problem with php and magick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Bonzo
Posts: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Problem with php and magick

Post by Bonzo » 2016-09-18T03:21:33-07:00

I am having a problem with something that used to work OK with convert but fails with magick.

An example:

Code: Select all

<?php
// This works without a problem
exec("magick input.jpg output.png");
?>

<?php 
// This fails with:
//Parse error: syntax error, unexpected '"<pre>"' (T_CONSTANT_ENCAPSED_STRING) in E:\XAMPP\htdocs\imagemagick\bla.php on line 9
// If I remove the echo "<pre>"; I then get:
// Parse error: syntax error, unexpected '$array' (T_VARIABLE) in E:\XAMPP\htdocs\imagemagick\bla.php on line 10
$array=array(); 
echo "<pre>"; 
exec("magick input.jpg output.png 2>&1", $array);  
echo "<br>".print_r($array)."<br>";  
echo "</pre>";
?> 
Any ideas as this method of error reporting used to work with convert?

Post Reply