使用imageMagick操作图片

参考:
http://image.intervention.io/getting_started/introduction(官方)
https://blog.csdn.net/qq_27295403/article/details/90023669
https://blog.csdn.net/beyond__devil/article/details/62230610
https://www.cnblogs.com/showker/p/11272130.html (因为容器用的alpine只能编译安装)
https://www.cnblogs.com/showker/p/11272130.html(安装,先安装gcc和make)
https://blog.csdn.net/gxl_ct001/article/details/84433030(ubuntu安装)
https://cloud.tencent.com/developer/article/1539529(反思configure)

ubuntu安装
apt-get install php7.4-gd
apt-get install php-pear php7.4-dev
apt-get install imagemagick libmagickwand-dev
pecl install imagick
在php.ini添加extension=imagick.so
composer require intervention/image -vvv
  $qrcodeImg = Image::make($qrcodeUrl)->resize($width, $height);
  $mainImg = Image::make($template);
   // 将海报保存到本地
   $posterName = time().rand(1,9999).'.png';
   $path = env('ACTIVITY_POSTER_PATH').$posterName;
   $mainImg->insert($qrcodeImg, '', $left, $top)->save($path);

上面仅是简单的使用,具体操作还是看人家写的吧

posted @ 2020-10-14 19:01  蜗牛使劲冲  阅读(11)  评论(0)    收藏  举报  来源