Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block tolew1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tolew1 / gist:4074ce32945277b0fe0db85982a28509
Created May 28, 2016 — forked from doapp-ryanp/gist:1364489
Manual Imagick crop via gravity
View gist:4074ce32945277b0fe0db85982a28509
$this->imgMetadata['format'] = strtolower($this->imagickObj->getImageFormat());
$this->imgMetadata['width'] = $this->imagickObj->getImageWidth();
$this->imgMetadata['height'] = $this->imagickObj->getImageHeight();
$x = $y = 0;
switch ($gravity) {
case 'center':
// $gravity = \Imagick::GRAVITY_CENTER;
$x = ($this->imgMetadata['width']/2) - ($width/2);
You can’t perform that action at this time.