4

Only on iPad devices and only in latest 9.3 release, when you call [PHCachingImageManager requestImageForAsset:] with a legitimate target size (CGSize) it does not return a valid image. For example...

PHAsset *asset = self.assetsFetchResults[indexPath.item];
[self.imageManager requestImageForAsset:asset
                             targetSize:CGSizeMake(101, 101)
                            contentMode:PHImageContentModeAspectFill
                                options:nil
                          resultHandler:^(UIImage *result, NSDictionary *info) {
      cell.defectImageView.image = result;
  }];

will not return an image. This is in a collection view so the cell's image is just black. However, bumping up the target size to 190,190 will return SOME of the images from the device but not all. When bumping up the target size to 501, 501 all of the images are returned properly.

Obviously there has been some change to minimum targetSize requirements but it does not seem to be documented. When I run this on an iPad with iOS 9.2.1 it works without any issues. Is anyone else experiencing this?

Filing a radar but wanted to check...

mutable2112
  • 439
  • 4
  • 15
  • In my case, PHImageManager.defaultManager().requestImageForAsset has the same problem. – user872176 Apr 11 '16 at 03:23
  • I opened a radar with Apple, they are asking me for a test project that reproduces the issue. I created a new project and I'm not able to repro - so it may be something unique to my code. Will update here when I know more... – mutable2112 Apr 11 '16 at 18:27

1 Answers1

0

I met exactly the same problem and I fixed it.enter image description here

Andy Darwin
  • 478
  • 5
  • 19
  • 1
    Please post actual code as text instead of screenshots. Others can't copy and paste from your images. [See here](http://meta.stackoverflow.com/a/285557/1402846) for details. Thank you. – Pang Jun 20 '16 at 02:16