get_technical_datas(); $maxSize = $this->get_multiple($size, 16, 'bottom'); $srcWidth = $tech_datas[system_file::TC_DATAS_WIDTH]; $srcHeight = $tech_datas[system_file::TC_DATAS_HEIGHT]; if ($srcWidth > $maxSize || $srcHeight > $maxSize) { if ($srcWidth >= $srcHeight) { $newWidth = (int) $maxSize; $height = round($newWidth * $srcHeight / $srcWidth); $newHeight = $this->get_multiple($height, 16); } else { $newHeight = (int) $maxSize; $width = round($newHeight * $srcWidth / $srcHeight); $newWidth = $this->get_multiple($width, 16); } } else { $newHeight = $this->get_multiple($srcHeight, 16); $newWidth = $this->get_multiple($srcWidth, 16); } return array('width' => $newWidth, 'height' => $newHeight); } }