mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Update Upload.php
This commit is contained in:
parent
317e29fbd5
commit
522d89993b
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue