/** * Resize an image using the computed settings. * * @param UploadedFile $file * @param stdClass $style * @return void */ public function resize($file, $style) { $filePath = tempnam(sys_get_temp_dir(), 'STP') . '.' . $file->getFilename(); list($width, $height, $option) = $this->parseStyleDimensions($style); $method = "resize" . ucfirst($option); if ($method == 'resizeCustom') { $this->resizeCustom($file, $style->value)->save($filePath); } else { $this->{$method}($file, $width, $height)->save($filePath); } return $filePath; }