wenzhaot / InstagramPhotoPicker

Present Image Picker like Instagram
MIT License
449 stars 71 forks source link

Photos showing in landscape #11

Open codeSupreme opened 9 years ago

codeSupreme commented 9 years ago

Some of the photos that I choose from the picker are displaying in landscape or wrong orientation.

wenzhaot commented 9 years ago

Sorry! This UI is not support landscape.

codeSupreme commented 9 years ago

that is not what I am saying. I am saying that the picker is turning the image.

On Mon, Apr 27, 2015 at 1:13 AM, wenzhaot notifications@github.com wrote:

Sorry! This UI is not support landscape.

— Reply to this email directly or view it on GitHub https://github.com/wenzhaot/InstagramPhotoPicker/issues/11#issuecomment-96508990 .

Krystel commented 9 years ago

I am experiencing the same issue @codeSupreme. Were you able to fix it or have a workaround?

Thanks a lot

andrewjaykeller commented 9 years ago

The problem is that the images you are using were taken in portrait mode with the iPhone camera. This means that their UIImageOrientation is equal to right... You need to just rotate the image.. i.e. if your image is right then you need to rotate it 90 degrees. There are a ton of stack articles on this.

Here is what i do to properly orient images up no matter their input direction:

codeSupreme commented 9 years ago

I was able to solve my issue. I am using the cocoa pod and the pod was not updated with the latest version of code. In particular this function in TWPhotoPickerController was not reflected in the cocoa pod.

{

ALAsset * asset = [self.assets objectAtIndex:indexPath.row];

UIImage *image = [UIImage imageWithCGImage:asset.defaultRepresentation.

fullResolutionImage scale:asset.defaultRepresentation.scale orientation:( UIImageOrientation)asset.defaultRepresentation.orientation];

[self.imageScrollView displayImage:image];

if (self.topView.frame.origin.y != 0) {

    [self tapGestureAction:nil];

}

}

On Sat, May 16, 2015 at 9:06 AM, Krystel Chaccour notifications@github.com wrote:

I am experiencing the same issue @codeSupreme https://github.com/codeSupreme. Were you able to fix it or have a workaround?

Thanks a lot

— Reply to this email directly or view it on GitHub https://github.com/wenzhaot/InstagramPhotoPicker/issues/11#issuecomment-102624859 .

Krystel commented 9 years ago

Thanks @pushtheworldllc and @codeSupreme It was actually the same problem @codeSupreme faced, I'm using pods as well. And updating "didSelectItemAtIndexPath" method solved it for me :) Thank you !

wlzch commented 8 years ago

I also experienced this bug. @wenzhaot will you update your pods to fix this bug?

ReFiRnE commented 8 years ago

Thanks @codeSupreme! Your solution fixed my problem! @wenzhaot try solution above it works at least for me and @Krystel. Best wishes!

red010182 commented 8 years ago

Thanks @codeSupreme!