Created
August 25, 2022 13:38
-
-
Save relliv/278709525448f04aad4917b861af149e to your computer and use it in GitHub Desktop.
Trim white space in image with intervention
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://image.intervention.io/v2/api/trim | |
use Intervention\Image\ImageManager as Image; | |
$imagePath = storage_path('app\public\product\images\testa.jpg'); | |
$newPath = public_path('testa.jpg'); | |
$image = new Image(); | |
$res = $image->make($imagePath)->trim('top-left', null, 50, 30)->save($newPath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment