• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/File/Image/Imagick.php
  • Класс: BitrixMainFileImageImagick
  • Вызов: Imagick::setJpegOptions
protected function setJpegOptions()
{
	$this->jpegSize = $this->getJpegSize();

	if ($this->jpegSize)
	{
		$source = $this->getInfo()->toRectangle();

		$needResize = $source->resize($this->jpegSize, FileImage::RESIZE_PROPORTIONAL);

		if ($needResize)
		{
			// the image is too large to fit into memory
			$this->image->setOption('jpeg:size', $this->jpegSize->getWidth() . 'x' . $this->jpegSize->getHeight());
			$this->image->setSize($this->jpegSize->getWidth(), $this->jpegSize->getHeight());

			return true;
		}
	}
	return false;
}