You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered an issue during the opening and closing animations when the following conditions are met:
Delegate's photosViewController:referenceViewForPhoto: returns an UIImageView.
The UIImageView's image is a photo taken with the device in portrait orientation (i.e. the UIImage has meaningful orientation informations associated).
If this is the case, the image is shown in the wrong orientation during the animation:
Here you find a simple demo project reproducing the issue. The project is build against the latest iOS 9 SDK and I have tested it on iOS 8 & 9 devices with the same results.
By tracking down the issue, it seems to be related to the newAnimationViewFromView: method of NYTPhotoTransitionAnimator, and to the following lines in particular:
When view is a UIImageView, its layer's contents is a CGImage and that seems to strip out the orientation information of the corresponding UIImage. By quick looking at the variables in the debugger, the resulting animationView appears to be rotated and doesn't look the same as the original view.
This is not an issue with UIImage-s that don't store meta-informations about their own orientation, but it seems to be a problem with—at least—portrait image taken from the device's camera.
At the moment I'm using a patch (that I am about to send as pull request) addressing UIImageView-s to overcome this problem. Here you find another version of the demo project with the patch applied.
Thanks!
The text was updated successfully, but these errors were encountered:
I may be a little late to the game here, but I was not able to reproduce this issue with the sample project provided above using an iPhone 6 device on iOS 9. Is there something special required beyond the steps mentioned above?
I have encountered an issue during the opening and closing animations when the following conditions are met:
photosViewController:referenceViewForPhoto:
returns anUIImageView
.UIImageView
's image is a photo taken with the device in portrait orientation (i.e. theUIImage
has meaningful orientation informations associated).If this is the case, the image is shown in the wrong orientation during the animation:
![orientation-issue](https://cloud.githubusercontent.com/assets/2843411/12217269/f89bee42-b6fb-11e5-9ec2-bdbf85f7143a.gif)
Here you find a simple demo project reproducing the issue. The project is build against the latest iOS 9 SDK and I have tested it on iOS 8 & 9 devices with the same results.
By tracking down the issue, it seems to be related to the
newAnimationViewFromView:
method ofNYTPhotoTransitionAnimator
, and to the following lines in particular:When
view
is aUIImageView
, its layer'scontents
is aCGImage
and that seems to strip out the orientation information of the correspondingUIImage
. By quick looking at the variables in the debugger, the resultinganimationView
appears to be rotated and doesn't look the same as the originalview
.This is not an issue with
UIImage
-s that don't store meta-informations about their own orientation, but it seems to be a problem with—at least—portrait image taken from the device's camera.At the moment I'm using a patch (that I am about to send as pull request) addressing
UIImageView
-s to overcome this problem. Here you find another version of the demo project with the patch applied.Thanks!
The text was updated successfully, but these errors were encountered: