views:

617

answers:

1

Hey There,

I'm currently having some troubles with TTPhotoViewController : I try to display some photos (taken from my iPhone 3GS camera), and the orientation of the displayed pictures are almost always erroneous ...

I mean that for example a photo taken in landscape mode will sometimes be displayed correctly, sometimes it will be upside down, sometimes it will be rotated ...

I've also noticed that a photo taken in portrait mode will be rotated (and so will take more than the whole screen), but rotating the iPhone will make it fit the screen well ...

I think I'm going mad :) any help would be greatly appreciated, thanks by advance.

EDIT : It seems it's a matter of size. I tried to downscale my picture and TTPhotoViewController doesn't screw up anymore, and then I try to rescale it to its initial size and the problem is occuring again. I can't understand that problem as a "memory limit" one, as my picture was taken with my iPhone ; moreover a UIImageView display it well ...

If anyone has a suggestion ...

+1  A: 

You probably set size: attribute of the photoSource to some wrong value.

Edit: Unfortunately i don't have another suggestion for your problem, however i have a warning. You should definitely scale your image before display, 1536x2048 is way too large for iphone to handle, and totally unnecessary for a 320x480 screen. Otherwise you are sure to have app crashes due to low memory in the future - if not now.

ahmet emrah
unfortunately I set the size attribute to the right value, I even entered it manually ...The problem is not the size, but the fact that the picture is displayed in landscape (rotation -PI/2) indeed of portrait, which would be the right photo orientation.I tried to load the photo into a UIImage and with UIImage, the orientation is ok, I can't understand ...Would you have any other idea ?my code to load the photo below : MockPhoto *m = [[MockPhoto alloc] initWithURL:@"bundle://img3.jpg" smallURL:@"bundle://img3.jpg" size:CGSizeMake(1536.0, 2048.0)];
Taku
Arg seems you're right ...I tried to downscale my picture and TTPhotoViewController doesn't screw up anymore, and then I try to rescale it to its initial size and the problem is occuring again.I can't understand that problem as a "memory limit" one, as my picture was taken with my iPhone ; moreover a UIImageView display it well ...If you have any suggestion I'd be very happy.
Taku