时时商务社区

标题: PHP 实现等比压缩图片尺寸和大小实例代码 [打印本页]

作者: 新格网络    时间: 2018-2-14 05:32

            废话不多说了,直接给大家贴php等比压缩图片大小的相关代码了,具体代码如下所示:
$maxwidth) && ($maxheight && $pic_height > $maxheight))
{
if($maxwidth && $pic_width>$maxwidth)
{
$widthratio = $maxwidth/$pic_width;
$resizewidth_tag = true;
}
if($maxheight && $pic_height>$maxheight)
{
$heightratio = $maxheight/$pic_height;
$resizeheight_tag = true;
}
if($resizewidth_tag && $resizeheight_tag)
{
if($widthratio
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
            
            
您可能感兴趣的文章:
  • php使用imagick模块实现图片缩放、裁剪、压缩示例
  • php实现批量压缩图片文件大小的脚本
  • PHP实现图片压缩的两则实例
  • PHP添加图片水印、压缩、剪切的封装类
  • php图片水印添加,压缩,剪切的封装类实现
  • PHP实现图片上传并压缩
  • php上传图片并压缩的实现方法
  • 基于PHP实现等比压缩图片大小
  • php gd等比例缩放压缩图片函数
  • php中10个不同等级压缩优化图片操作示例
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2