Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagecropauto feature #289

Open
Nicero opened this issue Dec 1, 2021 · 2 comments
Open

Imagecropauto feature #289

Nicero opened this issue Dec 1, 2021 · 2 comments

Comments

@Nicero
Copy link

Nicero commented Dec 1, 2021

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

$cropped = imagecropauto($image, IMG_CROP_WHITE);
@Nicero Nicero changed the title autocrop or imagecropauto Imagecropauto feature Dec 1, 2021
@claviska
Copy link
Owner

claviska commented Dec 1, 2021

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

@BodyEND
Copy link

BodyEND commented May 7, 2022

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;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants