Изображения
- 1 ответ
- 0 вопросов
2
Вклад в тег
<html>
<head>
<title>EXIF ORIENTATION TEST</title>
</head>
<body>
<img src="/image.jpg" />
</body>
</html>
$img = new Imagick($uploaded_img);
$orientation = $img->getImageOrientation();
switch($orientation) {
case imagick::ORIENTATION_BOTTOMRIGHT:
$img->rotateimage("#000", 180); // rotate 180 degrees
break;
case imagick::ORIENTATION_RIGHTTOP:
$img->rotateimage("#000", 90); // rotate 90 degrees CW
break;
case imagick::ORIENTATION_LEFTBOTTOM:
$img->rotateimage("#000", -90); // rotate 90 degrees CCW
break;
}
$img->setImageOrientation(imagick::ORIENTATION_TOPLEFT);
$img->writeImage($uploaded_img);
$img->clear();
$img->destroy();
$img = new Imagick($uploaded_img);
$img->stripImage();
$img->writeImage($uploaded_img);
$img->clear();
$img->destroy();
header ("Content-Type: text/html; charset=utf-8");
header ("Content-type: application/json");
echo error_reporting(E_ALL);
error_reporting(E_ALL);