English 中文(简体)
存放在丢失EXIF标签的文件上的UIImage校正
原标题:Correcting orientation of UIImage stored in document with lost EXIF tags

I have encountered a similar problem to others on SO regarding the orientation of UIImages taken using the iPad camera. Essentially, I am taking a UIImage using the camera on the iPad. When I then display it, it has rotated through 90 degrees.

从阅读其他问题和答案来看,我现在的理解是,照相带照相机时,它储存着一台EXIF标记,确定照片的方向。 这通常允许所有麦克风和西里望读到这一取向数据。 然而,我正在把我的图像储存在文件目录中,如NSData(通过UIImagePNGRepresentation进行转换,并在核心数据中拯救URL)。 我正开始这样做,正造成我失去从中取回的图象。

谁能想办法纠正这种情况?

思想、建议和观点都受到欢迎。

Many thanks

最佳回答

EXIF元数据在定位上并不准确,在全球定位系统数据中准确,它将只检测90和90;180和amp; 270, 有一些Error案试图这样做。

iOS UIImPicker Controller在上载后得出图像方向

Good Luck

问题回答

EXIF是图像档案,而不是UIImage。 当你带照相机拍照时,UIImagePicker从不把照片保存在档案中,因此,现在还没有EXIF。

但是,在你看来,问题与议会的方向无关。 我认为,UIImagePNGRepresentation总能节省90度(不论轮换)。 你在组建一个全国过渡政府之前,才需要轮换。 我不知道为什么这样做,但你只是需要围绕它开展工作。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签