// check if convert is configured if(!$conf['im_convert']) return false; // prepare command $cmd = $conf['im_convert']; $cmd .= ' -filter Lanczos -resize -quality 10 '.$to_w.'x'.$to_h.'!'; if ($ext == 'jpg' || $ext == 'jpeg') { $cmd .= ' -quality '.$conf['jpg_quality']; } $cmd .= " $from $to"; @exec($cmd,$out,$retval); if ($retval == 0) return true; return false;