zoukankan      html  css  js  c++  java
  • C#实现根据图片的EXIF自动调整图片方向

    一、什么是 EXIF

      

    Exif是英文Exchangeable Image File(可交换图像文件)的缩写,最初由日本电子工业发展协会(JEIDA --Japan Electronic Industry Development Association) 制订,目前的最新版本是发表于2002年04月的2.21 版。国际标准化组织(ISO)正在制订的相机文件设计标准(DCF -- Design role for Camera File system)可能以Exif2.1为基础。

          所有的JPEG文件以字符串“0xFFD8”开头,并以字符串“0xFFD9”结束。文件头中有一系列“0xFF??”格式的字符串,称为“标识”,用来标记JPEG文件的信息段。“0xFFD8”表示图像信息开始,“0xFFD9”表示图像信息结束,这两个标识后面没有信息,而其它标识紧跟一些信息字符。

      0xFFE0 -- 0xFFEF之间的标识符称为“应用标记”,没有被常规JPEG文件利用,Exif正是利用这些信息串记录拍摄信息如快门速度、光圈值等,甚至可以包括全球定位信息。其中拍摄方向的ID为“0x0112”,有1至8共8种值。



    二、EXIF Orientation


    Orientation 
    The image orientation viewed in terms of rows and columns. 
    Tag = 274 (112.H) 
    Type = SHORT 
    Count = 1 
    Default = 1 
    1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. 
    2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. 
    3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. 
    4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. 
    5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. 
    6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. 
    7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. 
    8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. 
    Other = reserved


    一、使用C#旋转图片

    Code
  • 相关阅读:
    Java8新特性之Collectors
    java日期的运用(DateUtils工具类)
    正则表达式30分钟入门教程
    一篇非常好的Spring教程
    结合实际需求,在webapi内利用WebSocket建立单向的消息推送平台,让A页面和服务端建立WebSocket连接,让其他页面可以及时给A页面推送消息
    关于企业微信对接内部应用开发,access_token的管理机制和业务接口调用项目实战的八个要点
    企业微信使用DevTools但显示为空白,解决方法
    16.刚体碰撞事件监测与处理
    15.碰撞体
    14.刚体组件Rigidbody
  • 原文地址:https://www.cnblogs.com/lhb25/p/1543914.html
Copyright © 2011-2022 走看看