问题
A prompt and convenient way of gererating thumbnails from an ALAsset
is described in the answer to question "Generating custom thumbnail from ALAssetRepresentation" — see a blog post of the author.
The only issue I have with this method is that it completely ignores all the filters or red-eye removal effects applied to an image (say one taken with stock iOS 7 Photo app + any filter in 'square' mode).
How should the code be adjusted to return 'filtered' thumbnails?
P.S. I know I can get filtered image through fullScreenImage
method of ALAssetRepresentation
, but it's way too slow and could cause 'Terminated due to Memory Pressure' error.
回答1:
Thumbnails are reduced-size versions of pictures, used to help in recognizing and organizing them, serving the same role for images as a normal text index does for words. So it usually doesn't apply all the filters or picture effects due to reduced-size concept.
To get ALAsset with applied filter or picture effects is fullResolutionImage
.
It doesn't cause any slow, if you are doing the UI updates on main thread or using Lazy loading concepts.
It doesn't cause any Memory Pressure, if you are keeping the ALAsset url's instead of storing the fullResolutionImage
.
来源:https://stackoverflow.com/questions/21286730/fast-way-of-obtaining-thumbnail-from-alasset-with-filtered-applied