|
@ -113,6 +113,8 @@ abstract class Upload |
|
|
} else { |
|
|
} else { |
|
|
$greagwar_image = self::getGreagwarImage($tmp_file_path); |
|
|
$greagwar_image = self::getGreagwarImage($tmp_file_path); |
|
|
} |
|
|
} |
|
|
|
|
|
$image->type = $greagwar_image->guessType(); |
|
|
|
|
|
if (!Config::get('PYTHON_PIL_RESIZE')) { |
|
|
if ($width || $height) { |
|
|
if ($width || $height) { |
|
|
if (!(ImageVariant::getIsClass($image)) && Image::getIsSubClass($image)) { |
|
|
if (!(ImageVariant::getIsClass($image)) && Image::getIsSubClass($image)) { |
|
|
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = true); |
|
|
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = true); |
|
@ -120,8 +122,11 @@ abstract class Upload |
|
|
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = false); |
|
|
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
$image->type = $greagwar_image->guessType(); |
|
|
|
|
|
$file_path = $greagwar_image->cacheFile($image->type, $quality = 100, true); |
|
|
$file_path = $greagwar_image->cacheFile($image->type, $quality = 100, true); |
|
|
|
|
|
} else { |
|
|
|
|
|
$hash = $greagwar_image->getHash($image->type, $quality = 100); |
|
|
|
|
|
$file_path = $greagwar_image->generateFileFromhash($hash); |
|
|
|
|
|
} |
|
|
$image->size = filesize($file_path); |
|
|
$image->size = filesize($file_path); |
|
|
$path_parts = pathinfo($file_path); |
|
|
$path_parts = pathinfo($file_path); |
|
|
$image->path = preg_replace('#^' . Config::get('PATH_WEB_ROOT') . '/#', '', $path_parts['dirname']); |
|
|
$image->path = preg_replace('#^' . Config::get('PATH_WEB_ROOT') . '/#', '', $path_parts['dirname']); |
|
|