2011-12-12 2 views

답변

10
[[asset defaultRepresentation] metadata]; 

은 지정된 저작물 표현에 대한 메타 데이터 사전을 반환합니다. 관심이있는 데이터에 대한 사전을 확인하십시오. 확실하지는 않지만 해당 사전 (및 하위)의 키가 CGImageProperties Reference 아래에 나열된 키와 같다고 생각합니다.

+0

감사합니다, 내가있는 NSDictionary 할 수있는 메타 데이터를로드,하지만 키를 구문 분석하는 방법을 모른다 . –

+0

해결되었습니다. 감사합니다. –

0

이다 한 자리에서 완전한 답변 ... 모든

NSDictionary *nsd = [[asset3 defaultRepresentation] metadata]; 
    NSString *widthStr = [nsd objectForKey: @"PixelWidth"]; 
    NSString *heightStr = [nsd objectForKey: @"PixelHeight"]; 

    NSLog(@"nsd: %@ ... widthStr: %@ ... heightStr: %@ ...", nsd, widthStr, heightStr); 

출력 :

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 ... 
관련 문제