+
+ // REAPPLY EXIF DATA
+ if($exif_orientation === imagick::ORIENTATION_BOTTOMRIGHT) {
+ $img->rotateImage("#000", 180);
+ } elseif ($exif_orientation === imagick::ORIENTATION_RIGHTTOP) {
+ $img->rotateImage("#000", 90);
+ } elseif ($exif_orientation === imagick::ORIENTATION_LEFTBOTTOM) {
+ $img->rotateImage("#000", -90);
+ }
+ $img->setImageOrientation(imagick::ORIENTATION_TOPLEFT);