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?".
<?php
/*
i want to use comand line to compress image in php
this code bellow works in cmd but does not works in php
*/
// in cmd type and run is ok
// convert -strip -quanlity 75% 0.jpg 00.jpg
// in php does not works
shell_exec('convert -strip -quanlity 75% 0.jpg 00.jpg');
// or
exec('convert -strip -quanlity 75% 0.jpg 00.jpg');
// but this is ok:
exec('convert -strip 0.jpg 00.jpg');
// why?
?>
A couple of things I see:
-quanlity should be -quality
-quality is between 1 and a 100 not 1% and 100%
The image is read in first and so it should be: exec('convert 0.jpg -strip -quality 75 00.jpg');