Skip to content

Instantly share code, notes, and snippets.

<?php
if(!function_exists(autoRotateImage)) {
function autoRotateImage($image) {
$orientation = $image->getImageOrientation();
switch($orientation) {
case imagick::ORIENTATION_BOTTOMRIGHT:
$image->rotateimage("#000", 180); // rotate 180 degrees
break;