array(T_ZBX_INT, O_MAND,P_SYS, DB_ID, NULL), "width"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(1,2000), NULL), "height"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(1,2000), NULL), ); check_fields($fields); ?> $th_width || $src_height > $th_height){ if($th_width == 0) { $th_width = $th_height * $src_width/$src_height; } else if($th_height == 0) { $th_height = $th_width * $src_height/$src_width; } else { $a = $th_width/$th_height; $b = $src_width/$src_height; if($a > $b){ $th_width = $b * $th_height; $th_height = $th_height; } else { $th_height = $th_width/$b; $th_width = $th_width; } } if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $thumb = imagecreatetruecolor($th_width,$th_height); } else { $thumb = imagecreate($th_width,$th_height); } imagecopyresized( $thumb, $source, 0, 0, 0, 0, $th_width, $th_height, $src_width, $src_height); imagedestroy($source); $source = $thumb; } } ImageOut($source); ?>