7

In iOS 9, I selected a photo from an album. After obtaining the ALAsset, I called the "thumbnail" to get a thumbnail and display it but photos are blurred.

In iOS 8, ALAsset.thumbnail size are 150 * 150, but in iOS 9 its 75 * 75

This is my code:

self.image = [UIImage imageWithCGImage:self.asset.thumbnail];
//self.image.size is 75*75     in ios9
//self.image.size is 150*150     in ios8

How can I solve this problem?

If I use:

[self.asset defaultRepresentation] fullScreenImage]

Then I get poor efficiency.

Ty Lertwichaiworawit
  • 2,950
  • 2
  • 23
  • 42
Tyler
  • 173
  • 9
  • Yes, you should use `Photos` framework to refactor it. Example: [Example app using Photos framework](https://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html) – qiz Sep 21 '15 at 13:08
  • I bumped into this too and submitted it as a bug – Pieter Oct 01 '15 at 15:25

2 Answers2

13

I also had this problem and solved it by using asset.aspectRatioThumbnail

    UIImageView *imageView;
    [imageView setImage:[UIImage imageWithCGImage:[asset aspectRatioThumbnail]]];
    [imageView setContentMode:UIViewContentModeScaleAspectFill];
Ty Lertwichaiworawit
  • 2,950
  • 2
  • 23
  • 42
0

I meet this problem. ALAsset available in iOS 4.0 and later deprecated in iOS 9.0. You can use PHAsset instead in iOS9.

yezi
  • 1