I wrote a custom image picker based on ALAssetsLibrary
, everything works fine but VoiceOver
, every photo are only representing as "Button", I think that is not good.
So I checked the Photo
app that built in iOS, VoiceOver
spoke following information for each photo:
photo
or video
or screenshot
etc.portrait
or landscape
.creation date
of it.sharp
or blurry
.bright
or dark
.I think I can get the first three from ALAsset
's properties, which is
ALAssetPropertyType
ALAssetPropertyOrientation
ALAssetPropertyDate
But how about sharpness and brightness? Can I get them from image Metadata or derive them out?
Update:
In the Photo's EXIF metadata:
But Photos.app
always have right brightness and sharpness values for any kind of photo, is it possible to do this by ourselves?
You can get values using EXIF
metadata.
All the keys are refferenced in Apple's Docs here and here
Here I wrote an example:
NSDictionary *allMetadata = [[asset defaultRepresentation] metadata];
NSDictionary *exif = [allMetadata objectForKey:(NSString*)kCGImagePropertyExifDictionary];
and than get sharpness
and brightness
NSNumber *sharpness = [exif objectForKey:(NSString*)kCGImagePropertyExifSharpness];
NSNumber *brightness = [exif objectForKey:(NSString*)kCGImagePropertyExifBrightnessValue];