iosobjective-calasset

ios9, ALAsset.thumbnail.size is {75,75}?


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.


Solution

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

        UIImageView *imageView;
        [imageView setImage:[UIImage imageWithCGImage:[asset aspectRatioThumbnail]]];
        [imageView setContentMode:UIViewContentModeScaleAspectFill];