note 119455 added to imagick.rotateimage

From: Date: Fri, 10 Jun 2016 12:59:35 +0000
Subject: note 119455 added to imagick.rotateimage
Groups: php.notes 
Request: Send a blank email to php-notes+get-205678@lists.php.net to get a copy of this message
Some transformations including Imagick ::rotateImage() may change "image page" -- working area inside the image you work on. Be careful with future modifications afterwards because the image page would be different from new sizes of the image. For example, if you do Imagic::cropImage() after rotation, you need to set image page properly, otherwise your crop would be performed relating to wrong coordinates (depending on rotation angle, resulting image size may vary). <?php $Image = new Imagick($sourceImagePath); $transparent = '#00000000'; $Image->rotateImage(new \ImagickPixel(), 45); // This makes resulting image bigger // Set page to be of the full size of new image, starting at top left corner (0, 0) $Image->setImagePage($Image->getImageWidth(), $Image->getImageHeight(), 0, 0); $Image->cropImage($crop_w, $crop_h, $crop_x, $crop_y); ?> ---- Server IP: 72.52.91.14 Probable Submitter: 217.138.10.29 ---- Manual Page -- http://php.net/manual/en/imagick.rotateimage.php Edit -- https://master.php.net/note/edit/119455 Del: integrated -- https://master.php.net/note/delete/119455/integrated Del: useless -- https://master.php.net/note/delete/119455/useless Del: bad code -- https://master.php.net/note/delete/119455/bad+code Del: spam -- https://master.php.net/note/delete/119455/spam Del: non-english -- https://master.php.net/note/delete/119455/non-english Del: in docs -- https://master.php.net/note/delete/119455/in+docs Del: other reasons-- https://master.php.net/note/delete/119455 Reject -- https://master.php.net/note/reject/119455 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205678) next »