diff --git a/src/Common/Upload.php b/src/Common/Upload.php index 788986a31..5fba7cd23 100644 --- a/src/Common/Upload.php +++ b/src/Common/Upload.php @@ -9,6 +9,9 @@ namespace TorrentPier\Common; +use claviska\SimpleImage; +use Exception; + /** * Class Upload * @package TorrentPier\Common @@ -165,14 +168,14 @@ class Upload if (($this->cfg['max_width'] && $width > $this->cfg['max_width']) || ($this->cfg['max_height'] && $height > $this->cfg['max_height'])) { for ($i = 0, $max_try = 3; $i <= $max_try; $i++) { try { - $image = new \claviska\SimpleImage(); + $image = new SimpleImage(); $image ->fromFile($this->file['tmp_name']) ->autoOrient() ->resize($this->cfg['max_width'], $this->cfg['max_height']) ->toFile($this->file['tmp_name']); break; - } catch (\Exception $e) { + } catch (Exception $e) { if ($i == $max_try) { $this->errors[] = sprintf($lang['UPLOAD_ERROR_DIMENSIONS'], $this->cfg['max_width'], $this->cfg['max_height']); return false;