public function applyFilter($loadFromPath, $imageSavePath) { if (!$this->evalMethod()) { throw new InvalidConfigException('The requested effect mode ' . $this->effect->imagine_name . ' is not supported'); } if (!$this->evalRequiredMethodParams()) { throw new InvalidConfigException("The requested effect mode does require some parameters which are not provided."); } switch ($this->effect->imagine_name) { case "crop": $image = Image::crop($loadFromPath, $this->getMethodParam('width'), $this->getMethodParam('height')); Image::autoRotate($image)->save($imageSavePath, $this->getMethodParam('saveOptions')); break; case "thumbnail": $image = Image::thumbnail($loadFromPath, $this->getMethodParam('width'), $this->getMethodParam('height'), $this->getMethodParam('mode')); Image::autoRotate($image)->save($imageSavePath, $this->getMethodParam('saveOptions')); break; } }