phMagick code samples

These are the code examples available for phMagick

Browse them, read the code, see the result of each code block, and have fun

If you have questions ot suggestions just drop us a line

Proportional Resize

Resizes an Image while mantaining aspect ratio (not distorcing the image).
Because of Aspect Ration constrains, the final image might not have the specified size, but it will have the closest possible without distorcing the image.

Code:

        $phMagick = new \phMagick\Core\Runner();

        $resizeAction = new \phMagick\Action\Resize\Proportional($this->originalFile, $this->newFile);
        $resizeAction->setWidth(100);
        $phMagick->run($resizeAction);