well, I figured the formula, but not sure if it's the simplest one.
so if someone need it here is my code:
1. open functions.php file
2. search for:
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
add after:
$height_limited = 800;
$width_limited = 800;
$dimension = $width_limited;
if ($width > $width_limited || $height > $height_limited && !$width && !$height) {
$ratio = $width / $height;
if ($ratio > 1) {
$width_limited = $dimension;
$height_limited = floor(($dimension/$width) * $height);
}else{
$width_limited = floor(($dimension/$height) * $width);
$height_limited = $dimension;
}
}elseif ($width || $height) {
$width_limited = $width;
$height_limited = $height;
}
4. in same file search for:
"height" => $height,
5. add after:
"width_limited" => $width_limited,
"height_limited" => $height_limited,
now u can use
{width_limited} or {height_limited} in your templates.
so, if u want limit your pictures, flash files, video files, etc. size u can change {width_height}
to this:width="{width_limited}" height="{height_limited}"