• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/api/photouploader.php
  • Класс: BitrixSaleTradingPlatformVkApiPhotoUploader
  • Вызов: PhotoUploader::setUploadServerMainPhotoParams
static function setUploadServerMainPhotoParams($photoId)
{
	$result = array();
	$result["main_photo"] = 1;
	
	$photoParams = CFile::GetFileArray($photoId);
	$w = $photoParams["WIDTH"];
	$h = $photoParams["HEIGHT"];
	
	if ($w >= $h)
	{
		$result["crop_x"] = ceil(($w + $h) / 2);
		$result["crop_y"] = 0;
		$result["crop_width"] = $h;
	}
	else
	{
		$result["crop_x"] = 0;
		$result["crop_y"] = ceil(($w + $h) / 2);
		$result["crop_width"] = $w;
	}
	
	return $result;
}