Unable to get [ALSset thumbnail] for image, but works for video

I am trying to display a thumbnail for an image or video that my application is taking. It works great for video, but for the image it just doesn't show anything. This is the code I used:

[assetImageView setImage:[UIImage imageWithCGImage:[asset thumbnail]]]; 

I also tried this as an alternative, but also nothing:

 ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; UIImage *image = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage]]; [assetImageView setImage:image]; 

Any ideas what could happen?

+4
source share
2 answers

The problem is not with this method, it was before. I did not save the object-object, so it was lost before reaching this line. Thanks for the help.

+4
source

Could you show us the result of NSLog(@"asset:%@", asset) when a problem occurs? Your first code works fine in my environment.

+1
source

All Articles