tags:

views:

419

answers:

3

Hi

I am using a TTPhotoViewController subclass in my project to display a series of images downloaded from the web. Some of the images which are not the same aspect ratio as the iPhone's screen are cropped out.

I tested this with square images of 400x400 px and all such images seem to be cropped out towards the edges. I cannot zoom out and view the entire image either.

Can someone please suggest a solution for this. Thanks.

A: 

Did you set up the CGSize of the image to be 400x400?

[[[MockPhoto alloc]
      initWithURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d.jpg?v=0"
      smallURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d_t.jpg"
      size:CGSizeMake(320, 480)] autorelease]

If the CGSize is properly set, you should be able to zoom in and out of the entire image. I have done this using Picasa and Flickr with no problems on zooming.

John Wang
I tried using 320x480. But then if I want to get the height and width of the photo being displayed I always get 320x480 (even though the photo being displayed is much smaller). I need to use the actual size of the photo being displayed as well. So can't use this method.
lostInTransit
A: 

Thanks a million! Applying that patch worked

Ian Wagner