加入收藏 | 设为首页 | 会员中心 | 我要投稿 北几岛 (https://www.beijidao.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – 旋转图像降低质量

发布时间:2021-08-28 03:48:10 所属栏目:大数据 来源: https://www.jb51.cc
导读:我有一个页面,用户可以向左和向右旋转图像. 问题是当用户旋转图像4-5次时质量大大降低! 我做错了吗? $image_source = imagecreatefromjpeg($path_u); $rotate = imagerotate($image_source, $angle, 0); imageinterlace($rotate, true); //this is to crea

我有一个页面,用户可以向左和向右旋转图像.

问题是当用户旋转图像4-5次时质量大大降低!

我做错了吗?

        $image_source = imagecreatefromjpeg($path_u);
        $rotate = imagerotate($image_source, $angle, 0);
        imageinterlace($rotate, true); //this is to create progressive jpeg
        imagejpeg($rotate, $path_u, 100);
        imagedestroy($rotate);

解决方法:

反复修改和重新压缩图像(特别是JPEG,无论质量设置如何都是有损的)必然会导致乘法伪像.您最好保留原始图像,并且在请求旋转时,重新旋转原稿,而不是每次都保存原始图像.

(编辑:北几岛)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读