php8.5
Home/ Manual/ imagick / imagick/ Imagick::setImageOrientation

Imagick::setImageOrientation

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Sets the image orientation

Description

Imagick::setImageOrientation(int $orientation): bool

Sets the image orientation.

Parameters

orientation

One of the orientation constants

Return Values

Success

Examples

Imagick::setImageOrientation()

php
<?php
//Doesn't appear to do anything
function setImageOrientation($imagePath, $orientationType) {
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->setImageOrientation($orientationType);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}

?>

Source: reference/imagick/imagick/setimageorientation.xml · from the official PHP manual (php/doc-en)