php – 旋转图像降低质量
发布时间:2020-12-13 16:50:12 所属栏目:PHP教程 来源:网络整理
导读:我有一个页面,用户可以向左和向右旋转图像. 问题是当用户旋转图像4-5次时质量大大降低! 我做错了吗? $image_source = imagecreatefromjpeg($path_u); $rotate = imagerotate($image_source,$angle,0); imageinterlace($rotate,true); //this is to create
我有一个页面,用户可以向左和向右旋转图像.
问题是当用户旋转图像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,无论质量设置如何都是有损的)必然会导致乘法伪像.您最好保留原始图像,并且在请求旋转时,重新旋转原稿,而不是每次都保存原始图像.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |