zoukankan      html  css  js  c++  java
  • 手机照片的exif里有方向属性

    <?php
    $image = imagecreatefromstring(file_get_contents($_FILES['image_upload']['tmp_name']));
    $exif = exif_read_data($_FILES['image_upload']['tmp_name']);
    if(!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;
     }
    }
    // $image now contains a resource with the image oriented correctly
    ?>

    需要上传之后改变一下属性,详见“七夕出租”游戏;

    2.js返回上一页并刷新:

    onclick="self.location=document.referrer;"
  • 相关阅读:
    10000000000
    vue生命周期
    react基础
    第一个react
    vuex状态管理2
    vue配合UI组件
    vuex
    vue-router配合vue-cli的实例
    vue-router2.0
    父子组件2.0
  • 原文地址:https://www.cnblogs.com/Basu/p/7902525.html
Copyright © 2011-2022 走看看