fuel/core — Issue #828: imagemagick problem for jpg when quality < 100
Author: Mitchell64
Created: 2012-02-11 18:02:32+00:00
State: open

I believe there may be a problem in core/classes/image/imagemagick.php, function save().

When the file type is jpg and quality is < 100, line 200 is true. The next call to $this->exec() causes an error at line 309.

Fuel\Core\FuelException [ Error ]: imagemagick failed to edit the image. Returned with 1.

Command: M:\xampp\ImageMagick-6.6.6-Q16\convert.exe "M:/xampp/tmp/fuelimage_addd141fd4817a4cb84ebd.png" -quality "75%" jpg "M:\xampp\htdocs\websites\art_manager_05_fuel\app\uploads\artist_00001\artwork_112_tn.jpg"

305 $passthru ? passthru($command) : exec($command, $output, $code);
306
307 if ($code != 0)
308 {
309 throw new \FuelException("imagemagick failed to edit the image. Returned with $code.
Command:\n $command");
310 }
311
312 return $output;
313 }

I think the error is in the call to $this->exec90 on line 204. If I replace the current line:
$this->exec('convert', $old.' -quality '.$quality.' '.strtolower($filetype).' '.$new);

with:
$this->exec('convert', $old.' -quality '.$quality.' '.$new);

It seems to work ok. I believe the $filetype param should not be included.