【问题标题】:Image displayed upside down in mac preview, but displayed right side up in the browser图像在 mac 预览中显示颠倒,但在浏览器中显示为右上
【发布时间】:2012-07-03 22:05:36
【问题描述】:

一个 jpg 在我的 Mac 上颠倒呈现,但在同一 Mac 上的 Safari 浏览器中正确呈现。什么是未正确读取的方向数据?它在 EXIF 中吗?

【问题讨论】:

    标签: image uiimage jpeg


    【解决方案1】:

    这里是如何以正确的方向显示它

      if (image.imageOrientation != UIImageOrientationUp)
      {            
        image = [UIImage 
                  imageWithCGImage: image.CGImage 
                  scale: 1 
                  orientation: UIImageOrientationUp];
      }
    

    基于 ravin Save UIImage, Load it in Wrong Orientation的回答

    【讨论】:

      猜你喜欢
      • 2013-07-27
      • 2021-06-13
      • 1970-01-01
      • 1970-01-01
      • 2015-10-21
      • 2021-11-25
      • 1970-01-01
      • 1970-01-01
      • 2014-11-13
      相关资源
      最近更新 更多