I have some simple code:
$original_image = imagecreatefromjpeg($image_path);
$cropped_image =imagecropauto($original_image , IMG_CROP_THRESHOLD, .5, 16777215);
magejpeg($cropped_image, "$destination.cropped.jpg",90);
but this code does not give the desired result. I actually expect that from my $original_image (jpg) the white border will be removed automatically.
This is the Input Image.
enter image description here
Whatever parameters I choose, imagecropauto() always returns the original image and not a cropped image.
Where else can the cause be?
PHP Version 7.3.7 + GD 2.1.0 compatible