SimpleImage icon indicating copy to clipboard operation
SimpleImage copied to clipboard

Imagecropauto feature

Open Nicero opened this issue 4 years ago • 2 comments

Does SimpleImage supports imagecropauto (as called in GD) to remove white (or black, etc) background?

$cropped = imagecropauto($image, IMG_CROP_WHITE);

Nicero avatar Dec 01 '21 16:12 Nicero

Not presently, but I'd accept a PR for it.

claviska avatar Dec 01 '21 16:12 claviska

For croping i am using this function

public function cropImage($cropType=IMG_CROP_DEFAULT) {
    $croppedImage = imagecropauto($this->image, $cropType);
    if ($croppedImage!== false) { 
      imagedestroy($this->image); 
      $this->image = $croppedImage; 
    }
    return $this;
  }

BodyEND avatar May 07 '22 09:05 BodyEND