2015-04-12 42 views
1

有没有办法使用干涉图像填充透明的黑色区域?使用干预图像裁剪小文件填充干涉图像

$data = file_get_contents("php://input"); 

    $img = Image::make($data); 

    $path = sprintf("%/data/%s/img",public_path(),Auth::user()->account_id); 

    @mkdir($path,0775,true); 

    $img->crop(350, 150)->encode('png', 90)->save(sprintf("%s/logo.png",$path)); 

Original

Croped image

回答

1

装饰方法解决了!

解决方案:

$img->crop(350, 150)->encode('png', 90)->trim()->save(sprintf("%s/logo.png",$path));