public function postOptimize($type, $file) { if ($this->getSetting('optimizeType') == 'task') { switch ($type) { case 'jpegoptim': $this->makeTask('Imager_Jpegoptim', $file); break; case 'jpegtran': $this->makeTask('Imager_Jpegtran', $file); break; case 'mozjpeg': $this->makeTask('Imager_Mozjpeg', $file); break; case 'optipng': $this->makeTask('Imager_Optipng', $file); break; case 'tinypng': $this->makeTask('Imager_TinyPng', $file); break; } } else { switch ($type) { case 'jpegoptim': $this->runJpegoptim($file); break; case 'jpegtran': $this->runJpegtran($file); break; case 'mozjpeg': $this->runMozjpeg($file); break; case 'optipng': $this->runOptipng($file); break; case 'tinypng': $this->runTinyPng($file); break; } } }