• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/File/Image.php
  • Класс: BitrixMainFileImage
  • Вызов: Image::autoRotate
public function autoRotate($orientation)
{
	if ($this->engine->substituted())
	{
		// no need to rotated a stub image
		return false;
	}

	if($orientation > 1)
	{
		if($orientation == 7 || $orientation == 8)
		{
			$this->rotate(270);
		}
		elseif($orientation == 3 || $orientation == 4)
		{
			$this->rotate(180);
		}
		elseif($orientation == 5 || $orientation == 6)
		{
			$this->rotate(90);
		}

		if ($orientation == 2 || $orientation == 7 || $orientation == 4 || $orientation == 5)
		{
			$this->flipHorizontal();
		}

		$this->setOrientation(1);

		return true;
	}
	return false;
}