<?
if(is_array($arResult["PREVIEW_PICTURE"]))
{
	$arFileTmp = CFile::ResizeImageGet(		
						$arResult["PREVIEW_PICTURE"],		
						array("width" => 225, "height" => 138),		
						BX_RESIZE_IMAGE_PROPORTIONAL,		
						false		
					);		
	$arSize = getimagesize($_SERVER["DOCUMENT_ROOT"].$arFileTmp["src"]);		
	$arResult["PREVIEW_IMG"] = array(		
						"SRC" => $arFileTmp["src"],		
						"WIDTH" => IntVal($arSize[0]),		
						"HEIGHT" => IntVal($arSize[1]),		
					);
	if(!is_array($arResult["DETAIL_PICTURE"]) && $arResult["PREVIEW_PICTURE"]["WIDTH"]!= IntVal($arSize[0]))	
		$arResult["DETAIL_PICTURE"]=$arResult["PREVIEW_PICTURE"];
}
elseif(is_array($arResult["DETAIL_PICTURE"]))
{
	$arFileTmp = CFile::ResizeImageGet(		
						$arResult["DETAIL_PICTURE"],		
						array("width" => 225, "height" => 138),		
						BX_RESIZE_IMAGE_PROPORTIONAL,		
						false		
					);		
	$arSize = getimagesize($_SERVER["DOCUMENT_ROOT"].$arFileTmp["src"]);		
	$arResult["PREVIEW_IMG"] = array(		
						"SRC" => $arFileTmp["src"],		
						"WIDTH" => IntVal($arSize[0]),		
						"HEIGHT" => IntVal($arSize[1]),		
					);
	if($arResult["DETAIL_PICTURE"]["WIDTH"]== IntVal($arSize[0]))	
		unset($arResult["DETAIL_PICTURE"]);
}
?>

