Browse Source

Корректировка определения пути к файлу. на основе serializeOperations от GreagwarImage

master
Alexander Demidov 11 years ago
parent
commit
0f60a843a5
  1. 12
      Upload.class.php

12
Upload.class.php

@ -109,6 +109,13 @@ abstract class Upload
$greagwar_image = self::getGreagwarImage($tmp_file_path); $greagwar_image = self::getGreagwarImage($tmp_file_path);
} }
$image->type = $greagwar_image->guessType(); $image->type = $greagwar_image->guessType();
if (!Image::getIsSubClass($image)) {
if ( !( ImageVariant::getIsClass( $image ) ) && Image::getIsSubClass( $image ) ) {
$greagwar_image->resize( $width, $height, 0xffffff, $force = false, $rescale = false, $crop = true );
} else {
$greagwar_image->resize( $width, $height, 0xffffff, $force = false, $rescale = false, $crop = false );
}
}
$hash = $greagwar_image->getHash($image->type, $quality = 100); $hash = $greagwar_image->getHash($image->type, $quality = 100);
$file_path = $greagwar_image->generateFileFromhash($hash) . '.' . $image->type; $file_path = $greagwar_image->generateFileFromhash($hash) . '.' . $image->type;
if (Image::getIsSubClass($image)) { if (Image::getIsSubClass($image)) {
@ -137,11 +144,6 @@ abstract class Upload
ob_end_clean(); ob_end_clean();
} else { } else {
if ($width || $height) { if ($width || $height) {
if (!(ImageVariant::getIsClass($image)) && Image::getIsSubClass($image)) {
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = true);
} else {
$greagwar_image->resize($width, $height, 0xffffff, $force = false, $rescale = false, $crop = false);
}
$file_path = $greagwar_image->cacheFile($image->type, $quality = 100, true); $file_path = $greagwar_image->cacheFile($image->type, $quality = 100, true);
} }
} }

Loading…
Cancel
Save