3

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.

Community
  • 1
  • 1
knuku
  • 6,032
  • 1
  • 32
  • 42
  • The asset you get appears to be the original asset, with some metadata about modifications. See also: http://stackoverflow.com/questions/13305020/interpret-xmp-metadata-in-alassetrepresentation and http://stackoverflow.com/questions/11569137/how-do-you-get-the-cropped-version-of-an-image-using-alasset -- I would suggest filing a radar if you want this functionality more easily available. – Jesse Rusak Feb 23 '14 at 01:07

1 Answers1

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.

Shamsudheen TK
  • 28,767
  • 9
  • 64
  • 96
  • thanks for your response but it's likely you've confused `fullResolutionImage` with `fullScreenImage`, as former returns an image [unadjusted in any way](ALAssetRepresentation). anyway, it seems to me way slower than `getBytes:...` – knuku Jan 23 '14 at 10:23
  • UPD: meant to paste link to [`ALAssetRepresentation`](https://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetRepresentation_Class/Reference/Reference.html) class reference, sorry – knuku Jan 23 '14 at 11:19