Index: branches/RC/core/kernel/utility/formatters/upload_formatter.php =================================================================== diff -u -r9253 -r9256 --- branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 9253) +++ branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 9256) @@ -216,7 +216,10 @@ $upload_dir = isset($options['upload_dir']) ? $options['upload_dir'] : $this->DestinationPath; if (preg_match('/resize:([\d]*)x([\d]*)/', $format, $regs)) { - return $this->resizeImage(FULL_PATH.$upload_dir.$value, $regs[1], $regs[2]); + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ + + return $image_helper->ResizeImage(FULL_PATH.$upload_dir.$value, $regs[1], $regs[2]); } switch ($format) { @@ -246,35 +249,6 @@ return sprintf($format, $value); } - function resizeImage($src_image, $max_width, $max_height) - { - if ($max_width > 0 || $max_height > 0) { - $image_helper =& $this->Application->recallObject('ImageHelper'); - /* @var $image_helper ImageHelper */ - - list ($max_width, $max_height, $resized) = $image_helper->GetImageDimensions($src_image, $max_width, $max_height); - - if ($resized) { - $src_path = dirname($src_image); - $dst_image = preg_replace('/^'.preg_quote($src_path, '/').'(.*)\.(.*)$/', $src_path.'/resized\\1_'.$max_width.'x'.$max_height.'.\\2', $src_image); - if (!file_exists($dst_image) || filemtime($src_image) > filemtime($dst_image)) { - // resized image not available OR should be recreated due source image change - $image_resized = $image_helper->ScaleImage($src_image, $dst_image, $max_width, $max_height); - if (!$image_resized) { - // resize failed, because of server error - $dst_image = $src_image; - } - } - - // resize ok - $src_image = $dst_image; - } - } - - $base_url = rtrim($this->Application->BaseURL(), '/'); - return preg_replace('/^'.preg_quote(FULL_PATH, '/').'(.*)/', $base_url.'\\1', $src_image); - } - function ValidateFileName($path, $name) { $parts = pathinfo($name);