objective-c uiimage exif alassetslibrary assets

objective c - ¿Cómo obtener información exif de ALAsset?



objective-c uiimage (2)

[[asset defaultRepresentation] metadata];

devuelve un diccionario de diccionarios de metadatos para la representación de activos dada. Consulte este diccionario para obtener los datos que le interesan. No estoy seguro, pero creo que las claves en ese diccionario (y los subíndices) son las mismas que figuran en CGImageProperties Reference .

Necesito obtener información exif del activo seleccionado y mostrar parte de él en la pantalla.


Esta es una respuesta completa ... todo en un solo lugar

NSDictionary *nsd = [[asset3 defaultRepresentation] metadata]; NSString *widthStr = [nsd objectForKey: @"PixelWidth"]; NSString *heightStr = [nsd objectForKey: @"PixelHeight"]; NSLog(@"nsd: %@ ... widthStr: %@ ... heightStr: %@ ...", nsd, widthStr, heightStr);

salida:

nsd: { ColorModel = RGB; DPIHeight = 72; DPIWidth = 72; Depth = 8; Orientation = 1; PixelHeight = 1136; PixelWidth = 642; "{Exif}" = { ColorSpace = 1; ComponentsConfiguration = ( 1, 2, 3, 0 ); ExifVersion = ( 2, 2, 1 ); FlashPixVersion = ( 1, 0 ); PixelXDimension = 642; PixelYDimension = 1136; SceneCaptureType = 0; }; "{TIFF}" = { Orientation = 1; ResolutionUnit = 2; XResolution = 72; YResolution = 72; }; } ... widthStr: 642 ... heightStr: 1136 ...