Fast way of obtaining thumbnail from ALAsset with filtered applied

六眼飞鱼酱① 提交于 2019-12-22 11:09:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!