【发布时间】:2011-09-07 12:01:18
【问题描述】:
我有一张在 iPhone 上拍摄的 JPEG 图像。在我的台式电脑(Windows 照片查看器、Google Chrome 等)上,方向不正确。
我正在开发一个 ASP.NET MVC 3 Web 应用程序,我需要在其中上传照片(目前使用 plupload)。
我有一些服务器端代码来处理图像,包括读取 EXIF 数据。
我已尝试读取 EXIF 元数据中的 PropertyTagOrientation 字段(使用 GDI - Image.PropertyItems),但该字段不存在。
所以它要么是一些特定的 iphone 元数据,要么是一些其他的元数据。
我使用了另一个工具,例如 Aurigma Photo Uploader,它可以正确读取元数据并旋转图像。它是如何做到的?
有谁知道其他哪些 JPEG 元数据可能包含所需的信息,以便知道它需要被 Aurigma 使用旋转?
这是我用来读取 EXIF 数据的代码:
var image = Image.FromStream(fileStream);
foreach (var prop in image.PropertyItems)
{
if (prop.Id == 112 || prop.Id == 5029)
{
// do my rotate code - e.g "RotateFlip"
// Never get's in here - can't find these properties.
}
}
有什么想法吗?
【问题讨论】:
标签: c# image-processing metadata jpeg gdi