How to stop PHP iMagick auto-rotating images based on EXIF ‘orientation’ data

“However – iMagick, when __construct’ed with this image, automatically rotates it an additional 90 degrees CCW as per [Orientation] => 6 (I think!).” The problem is actually the opposite of that. Imagick doesn’t auto rotate the image. You’re only seeing it correctly in other software / your web browser because those programs do auto rotate … Read more

Get/set DPI with PHP GD/Imagick?

in order to use “getImageResolution();” you must be sure that resolution in “PixelsPerInch”…sometimes it can be “PixelsPerCentimeter” use following code to get image info: $imagick = new Imagick($filename); $data = $imagick->identifyimage(); var_dump($data); result (when PixelsPerInch): array(11) { [“imageName”]=> string(11) “/jpg300.jpg” [“format”]=> string(51) “JPEG (Joint Photographic Experts Group JFIF format)” [“units”]=> string(13) “PixelsPerInch” [“type”]=> string(9) “TrueColor” … Read more

How to use Imagick to merge and mask images?

So, finally, this should do what you need: Original image: Opacity mask: Overlay: Output: The code: <?php $base = new Imagick(‘U0R4F.png’); $mask = new Imagick(‘mask.png’); $over = new Imagick(‘3ulkM.png’); // Setting same size for all images $base->resizeImage(274, 275, Imagick::FILTER_LANCZOS, 1); // Copy opacity mask $base->compositeImage($mask, Imagick::COMPOSITE_DSTIN, 0, 0, Imagick::CHANNEL_ALPHA); // Add overlay $base->compositeImage($over, Imagick::COMPOSITE_DEFAULT, 0, … Read more

Install Imagick for PHP and Apache on Windows

EDIT: This procedure works with Windows 7 – 10 and all versions of PHP as well. Unofficial sites may be discontinued or later be altered to contain malicious code instead. Please use caution when using any recommended links or mirrors other than the official ImageMagick, PECL, or PHP sites provided in comments or other answers. … Read more