栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

PHP read_exif_data和调整方向

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PHP read_exif_data和调整方向

imagerotate文档为第一个参数引用的类型与您使用的类型不同:

由图像创建功能之一(例如imagecreatetruecolor())返回的图像资源。

这是使用此功能的一个小例子:

function resample($jpgFile, $thumbFile, $width, $orientation) {    // Get new dimensions    list($width_orig, $height_orig) = getimagesize($jpgFile);    $height = (int) (($width / $width_orig) * $height_orig);    // Resample    $image_p = imagecreatetruecolor($width, $height);    $image   = imagecreatefromjpeg($jpgFile);    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);    // Fix Orientation    switch($orientation) {        case 3: $image_p = imagerotate($image_p, 180, 0); break;        case 6: $image_p = imagerotate($image_p, -90, 0); break;        case 8: $image_p = imagerotate($image_p, 90, 0); break;    }    // Output    imagejpeg($image_p, $thumbFile, 90);}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/443013.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号