php生成图片缩略图的方法_PHP教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
缂備礁娲﹂埅绀慹deCMS閻熸瑥妫濋。鍫曞极濞嗘垟鏌�濞戞梹澹嗛埞鏍⒒閿燂拷 缂佸鍠愬﹢鍥礉閳ヨ櫕鐝� 闂侇偄顦辩紞澶屾兜閺囨氨闉嶉柤杈ㄦ缁憋拷 闁哄啰濮撮崪鏍博濞嗘挻姣愮€规悶鍎遍崣锟�,闁谎勫劤鐎规娊寮堕崘顔兼濞戞挴鍋撻梺娆惧枛閸欏繘寮婚敓锟�!
推荐:php获取网页里所有图片并存入数组的方法
本文实例讲述了php获取网页里所有图片并存入数组的方法。分享给大家供大家参考。具体如下: 希望本文所述对大家的php程序设计有所帮助。
这篇文章主要介绍了php生成图片缩略图的方法,涉及php操作图片的技巧,非常具有实用价值,需要的朋友可以参考下
本文实例讲述了php生成图片缩略图的方法。分享给大家供大家参考。具体如下:
这里需要用到GD2 library
- function make_thumb($src,$dest,$desired_width)
- {
- /* read the source image */
- $source_image = imagecreatefromjpeg($src);
- $width = imagesx($source_image);
- $height = imagesy($source_image);
- /* find the "desired height" of this thumbnail, relative to the desired width */
- $desired_height = floor($height*($desired_width/$width));
- /* create a new, "virtual" image */
- $virtual_image = imagecreatetruecolor($desired_width,$desired_height);
- /* copy source image at a resized size */
- imagecopyresized($virtual_image,$source_image,0,0,0,0,$desired_width,$desired_height,$width,$height);
- /* create the physical thumbnail image to its destination */
- imagejpeg($virtual_image,$dest, 83);
- }
分享:经典PHP加密解密函数Authcode()修复版代码
Authcode这个函数很多人都使用,这函数来自Discuz程序,用于加密解密字符串,可以设置钥匙(key)和过期时间,在很多时候都用得着。原版的函数代码可能会生成+、/、这样的字符,导致通过URL传值取回时被转义,导致无法解密。火端网络稍加修改,把这几个字符替换成其它
相关PHP教程:
- 相关链接:
- 教程说明:
PHP教程-php生成图片缩略图的方法
。