| version 1.41, 2006/09/27 12:32:25 |
version 1.42, 2006/09/27 12:51:56 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.40 2006-09-23 01:25:25 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.41 2006-09-27 12:32:25 nepto Exp $ */ |
| |
|
| function ezin_eval($evalcode) /* {{{ */ |
function ezin_eval($evalcode) /* {{{ */ |
| { |
{ |
| Line 631 function ezin_scale_upload_image($input_ |
|
| Line 631 function ezin_scale_upload_image($input_ |
|
| $width_pct = $width[strlen($width) - 1] == '%'; |
$width_pct = $width[strlen($width) - 1] == '%'; |
| $cache_dir = '_cache'; |
$cache_dir = '_cache'; |
| $uni_prefix = $ezin_cfg['upload']['dir'].'/'; |
$uni_prefix = $ezin_cfg['upload']['dir'].'/'; |
| $input_image = urldecode($input_image); |
$input_image = rawurldecode($input_image); |
| if ($width_int <= 0 || preg_match('|.bmp$|i', $input_image)) { |
if ($width_int <= 0 || preg_match('|.bmp$|i', $input_image)) { |
| return $input_image; |
return $input_image; |
| } |
} |
| Line 647 function ezin_scale_upload_image($input_ |
|
| Line 647 function ezin_scale_upload_image($input_ |
|
| $output_image .= ($width_pct ? 'pct' : 'abs').'--'; |
$output_image .= ($width_pct ? 'pct' : 'abs').'--'; |
| $output_image .= str_replace('/','--', $input_image); |
$output_image .= str_replace('/','--', $input_image); |
| if (file_exists($uni_prefix.$output_image)) { |
if (file_exists($uni_prefix.$output_image)) { |
| return $output_image; |
return rawurlencode($output_image); |
| } |
} |
| include_once 'Image/Transform.php'; |
include_once 'Image/Transform.php'; |
| $img = Image_Transform::factory('GD'); |
$img = Image_Transform::factory('GD'); |
| Line 658 function ezin_scale_upload_image($input_ |
|
| Line 658 function ezin_scale_upload_image($input_ |
|
| $img->scaleByX($width_int); |
$img->scaleByX($width_int); |
| } |
} |
| $img->save($uni_prefix.$output_image); |
$img->save($uni_prefix.$output_image); |
| return $output_image; |
return rawurlencode($output_image); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |