Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
luler committed Jun 25, 2021
1 parent e767e7b commit 5d09dbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/IdPhotoBackgroundSwitch/IdPhotoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function transformImage(string $from_image_path, string $to_image_
$background_color = self::positionBackgroupColor($old_image);
imagecolortransparent($old_image, $background_color);//将识别到的背景颜色替换成透明
imagecopymerge($new, $old_image, 0, 0, 0, 0, $old_image_width, $old_image_height, 100);//合并图片
imagepng($new, $to_image_path);//保存图片
imagejpeg($new, $to_image_path);//保存图片
imagedestroy($old_image);//销毁
imagedestroy($new);
}
Expand Down

0 comments on commit 5d09dbc

Please sign in to comment.