dongtazu3080 2016-03-13 21:05 采纳率: 100%
浏览 22

Google App Engine中的Php图像轮换

I am trying to fix orientation of images from mobile devices, using EXIF to get the orientation and switch/case to fix the orientation. Apparently my function was working offline and now it's not working on Google Apps Engine. Could Google have a specific function to do this?

The function:

$image = imagecreatefromjpeg($path);
$exif = exif_read_data($path);

if (!empty($exif['Orientation'])) {
    switch ($exif['Orientation']) {
        case 3:
            $image = imagerotate($image, 180, 0);
            break;
        case 6:
            $image = imagerotate($image, -90, 0);
            break;
        case 8:
            $image = imagerotate($image, 90, 0);
            break;
    }
    imagejpeg($image, $path);
}
  • 写回答

0条回答 默认 最新

      编辑
      预览

      报告相同问题?

      手机看
      程序员都在用的中文IT技术交流社区

      程序员都在用的中文IT技术交流社区

      专业的中文 IT 技术社区,与千万技术人共成长

      专业的中文 IT 技术社区,与千万技术人共成长

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      客服 返回
      顶部