請參閱下面的示例。在以下兩種情況下的PhotoDisplayViewController.m測試中,您將自動得到答案,無需解釋任何人。
案例1:UIImageOrientation
ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
UIImage *fullScreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage] scale:[assetRepresentation scale] orientation:(UIImageOrientation)[assetRepresentation orientation]];
案例2:用了UIImageOrientation
ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
UIImage *fullScreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage] scale:[assetRepresentation scale] orientation:nil];
當您從您的閱讀主張有一定的取向就像下面
UIImageOrientationUp, // default orientation
UIImageOrientationDown, // 180 deg rotation
UIImageOrientationLeft, // 90 deg CCW
UIImageOrientationRight, // 90 deg CW
UIImageOrientationUpMirrored, // as above but image mirrored along other axis. horizontal flip
UIImageOrientationDownMirrored, // horizontal flip
UIImageOrientationLeftMirrored, // vertical flip
UIImageOrientationRightMirrored, // vertical flip
所以請下載通過這個示例演示
MyImagePicker Demo
注: ,如果你想從那麼所有的專輯,你需要在RootViewController.m改變代碼如下
NSUInteger groupTypes = ALAssetsGroupAlbum | ALAssetsGroupEvent | ALAssetsGroupFaces|ALAssetsGroupLibrary|ALAssetsGroupSavedPhotos|ALAssetsGroupPhotoStream;
顯示
我得到的圖像定位爲所有圖像,但一些圖像旋轉我試過如果(temp.albumPictureClass == UIImageOrientationUP){NSLog(@「Up」);}所有圖像打印此消息 – Durgaprasad
這意味着您的圖像方向都是「向上」。所以我認爲你可以找到行哪個圖像旋轉90度,然後通過代碼旋轉它們......我的英語非常糟糕,所以我不能確定你能理解我說的話。 - !抱歉! – iuser1969782
是的,我明白了。我接受了你的方法。這是完美的。謝謝。 – Durgaprasad