Advertisement
Guest User

Untitled

a guest
May 30th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. // 메타 정보
  2. NSDictionary *metaDic = [NSDictionary dictionaryWithObjectsAndKeys:
  3. @"Software", (NSString *)kCGImagePropertyTIFFSoftware,
  4. @"Artist", (NSString *)kCGImagePropertyTIFFArtist,
  5. @"Description", (NSString *)kCGImagePropertyTIFFImageDescription, nil];
  6. NSDictionary *tiffDic = [NSDictionary dictionaryWithObject:metaDic forKey:(NSString *)kCGImagePropertyTIFFDictionary];
  7. // 이미지
  8. UIImage *image = [UIImage imageNamed:@"sampel.png"];
  9. // 이미지에 메타 정보를 기록하고, 저장
  10. ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease];
  11. [library writeImageToSavedPhotosAlbum:[image CGImage]
  12. metadata:tiffDic
  13. completionBlock:^(NSURL *newURL, NSError *error) {
  14. if (error) {
  15. NSLog(@"%@", [error localizedDescription]);
  16. } else {
  17. }
  18. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement