0

Here is the deal, I have tried using both of the methods shown below to save an image to the photo library. Upon saving the image successfully and launching the Photos App to take a look at the image, the app automatically scales/resizes the image to full screen.

Is there any way to prevent this? It is annoying because to see the whole image the user needs to pinch the image out to show the whole thing. I have noticed a few of the more popular camera apps do not have this issue when saving to the photo library. I am curious what method they are using.

//Save to Photo Library;
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
//CIImage *ciImage = image.CIImage;
[library writeImageToSavedPhotosAlbum:finalImage.CGImage
                          orientation:ALAssetOrientationUp
                      completionBlock:^(NSURL *assetURL, NSError *error) {
                          NSlog(@"Done");
                      }];

Save to Photo Library;
UIImageWriteToSavedPhotosAlbum(savedPhoto,nil,nil,nil);

Thank you for your help!

nielsbot
  • 15,922
  • 4
  • 48
  • 73
dana0550
  • 1,125
  • 1
  • 9
  • 16
  • are you saying they scale your image to fill the screen and cut off the postions on the sides? – nielsbot Jul 21 '12 at 20:12
  • Yes, but after the image is saved. It seems that I am not explaining this clearly. The issue is not within my app. It is after the image has been saved and then launching the Apple Photo Library App "Photos." – dana0550 Jul 23 '12 at 22:05
  • yes--i understand, just confirming. – nielsbot Jul 24 '12 at 01:52
  • what happens if you change orientations? – nielsbot Jul 24 '12 at 22:16
  • If I rotate the device to landscape the whole image shows up fine. It is just an issue when holding the device in portrait. It is how the photos app autoresizes to fit the whole screen. I am not sure why Apple does this. – dana0550 Jul 25 '12 at 13:50
  • i meant orientations of your saved image, not the orientation of your device. sorry :) – nielsbot Jul 25 '12 at 20:02
  • Well the orientation is always portrait for the saved photos – dana0550 Jul 26 '12 at 00:30

4 Answers4

1

After doing a bit of research there is no solution to this problem. The photos app automatically scales up the image to fill the screen.

Thanks for all of the responses.

dana0550
  • 1,125
  • 1
  • 9
  • 16
0

Saving image should be fine.

I think you can set UIView property UIViewContentMode, when you using the image.

typedef enum {
UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent
UIViewContentModeScaleAspectFill,     // contents scaled to fill with fixed aspect. some portion of content may be clipped.
UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)
UIViewContentModeCenter,              // contents remain same size. positioned adjusted.
UIViewContentModeTop,
UIViewContentModeBottom,
UIViewContentModeLeft,
UIViewContentModeRight,
UIViewContentModeTopLeft,
UIViewContentModeTopRight,
UIViewContentModeBottomLeft,
UIViewContentModeBottomRight,

} UIViewContentMode;

Hope it helps.

TK189
  • 1,490
  • 1
  • 13
  • 17
0

If you take a look at the FrogScroller sample application from Apple, you'll see they initially load a low-resolution of the image first and then, when zooming use a CATiledLayer with it's size set by the setMaxMinZoomScalesForCurrentBounds function.

You might want to look at WWDC 2010's video on scrollViews as well as 2011 for more info. Josh and Eliza do a great job explaining what's up.

SushiGrass Jacob
  • 19,425
  • 1
  • 25
  • 39
0

Why not layer the image onto a fullscreen image with a clear background before saving?

Nic Robertson
  • 1,198
  • 9
  • 26