Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 531
Tyler Avatar asked Sep 18 '15 09:09

Tyler


1 Answers

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

    UIImageView *imageView;
    [imageView setImage:[UIImage imageWithCGImage:[asset aspectRatioThumbnail]]];
    [imageView setContentMode:UIViewContentModeScaleAspectFill];
like image 98
Ty Lertwichaiworawit Avatar answered Nov 10 '22 11:11

Ty Lertwichaiworawit