600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > PHP 实现等比压缩图片尺寸和大小实例代码

PHP 实现等比压缩图片尺寸和大小实例代码

时间:2020-12-05 15:00:08

相关推荐

PHP 实现等比压缩图片尺寸和大小实例代码

php教程|PHP开发

PHP 图片 等比例压缩

php教程-PHP开发

废话不多说了,直接给大家贴php等比压缩图片大小的相关代码了,具体代码如下所示:

流量钓鱼源码,php vscode配置,Ubuntu方案,查找tomcat 配置,SQLITE下载软件开发,wordpress 卡片插件,前端3d地图框架,爬虫能为我们做些什么好事,php视频 百度网盘,铁岭seo推广商家,网站布局模仿,网页图片显示插件,ecshop 模板堂教程lzw

$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<$heightratio)$ratio = $widthratio;else$ratio = $heightratio;}if($resizewidth_tag && !$resizeheight_tag)$ratio = $widthratio;if($resizeheight_tag && !$resizewidth_tag)$ratio = $heightratio;$newwidth = $pic_width * $ratio;$newheight = $pic_height * $ratio;if(function_exists("imagecopyresampled")){$newim = imagecreatetruecolor($newwidth,$newheight);imagecopyresampled($newim,$im,,,,,$newwidth,$newheight,$pic_width,$pic_height);}else{$newim = imagecreate($newwidth,$newheight);imagecopyresized($newim,$im,,,,,$newwidth,$newheight,$pic_width,$pic_height);}$name = $name.$filetype;imagejpeg($newim,$name);imagedestroy($newim);}else{$name = $name.$filetype;imagejpeg($im,$name);}}

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

彩票手机挂机源码,vscode有没有智能输入,ubuntu安装casa,tomcat 压缩包,apple store爬虫,支持php的免费空间,权威seo整站优化找哪家,asp全静态企业网站,免费的模板素材怎么用lzw

更多PHP 实现等比压缩图片尺寸和大小实例代码相关文章请关注PHP中文网!

h5活动页面 源码,vscode中文问号,envi ubuntu,tomcat默认指向,sqlite插入l列数据,织梦 投票插件,兼容性较好的前端框架,Python爬虫算项目经历吗,iis php 性能,廊坊专业seo外包,偷了网站,wap手机网页游戏源码下载,手机搞笑网站模板下载安装lzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。