Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i check a ALAsset is a Image .How can i seperate image(.png) files from ALAssetGroup

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 ?

like image 627
Vipin Avatar asked Dec 01 '22 08:12

Vipin


1 Answers

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"]
like image 106
holtmann Avatar answered Dec 04 '22 07:12

holtmann