• 处理图片出现翻转的问题


    首先保证   php   开   exif  扩展

     function rote($file){
        $imagemodel = new Image();
             $info = $imagemodel::GetImageInfo($file);
             $type = empty($type) ? $info['type'] : $type;
             $type = strtolower($type);
             unset($info);
             $image = imagecreatefromstring(file_get_contents($file));
             //file_put_contents($log, $image.' ');
            $exif = @exif_read_data($file);
           if(isset($exif['Orientation']) && !empty($exif['Orientation'])) {
                                   switch($exif['Orientation']) {
                                                  case 8:
                                                  $image = imagerotate($image,90,0);
                                                  break;
                                                  case 3:
                                                  $image = imagerotate($image,180,0);
                                                  break;
                                                  case 6:
                                                 $image = imagerotate($image,-90,0);
                                                 break;
                                  }
             }
        $imageFun = 'image' . ($type == 'jpg' ? 'jpeg' : $type);
        $imageFun($image,$file);
        imagedestroy($image);    
     }

  • 相关阅读:
    angular 组件间数据共享
    Linux 常用命令
    angular 子路由跳转出现Navigation triggered outside Angular zone, did you forget to call ‘ngZone.run() 的问题修复
    angular :ngIf 的else用法
    利用 filter 来去重
    webpack打包时删除console.log,和debugger
    git忽略而不提交文件的3种情形
    jenkins 构建日程表配置
    vue之多页面的开发
    vue-cli3使用jq
  • 原文地址:https://www.cnblogs.com/lijiageng/p/5741486.html
Copyright © 2020-2023  润新知