4

How can i check a ALAsset is a Image? How can i seperate image(.png) files from ALAssetGroup.can i able to retrieve only the image(.png) files from iphone Photo libaray ?

Vipin
  • 4,718
  • 12
  • 54
  • 81

2 Answers2

15

First of all you need to enumerate the whole AssetGroup Then check every asset for 2 things:

1) For checking if the Asset is an image, query

[[asset valueForProperty:@"ALAssetPropertyType"] isEqualToString:@"ALAssetTypePhoto"]

2) if 1) is true then continue the check, if it is a PNG like this:

[[[asset defaultRepresentation] UTI] isEqualToString:@"public.png"]
holtmann
  • 6,043
  • 32
  • 44
5

Without using NSString:

[[asset valueForProperty:ALAssetPropertyType] isEqual:ALAssetTypeVideo]

Alex Spencer
  • 834
  • 2
  • 12
  • 23