Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 메타 정보
- NSDictionary *metaDic = [NSDictionary dictionaryWithObjectsAndKeys:
- @"Software", (NSString *)kCGImagePropertyTIFFSoftware,
- @"Artist", (NSString *)kCGImagePropertyTIFFArtist,
- @"Description", (NSString *)kCGImagePropertyTIFFImageDescription, nil];
- NSDictionary *tiffDic = [NSDictionary dictionaryWithObject:metaDic forKey:(NSString *)kCGImagePropertyTIFFDictionary];
- // 이미지
- UIImage *image = [UIImage imageNamed:@"sampel.png"];
- // 이미지에 메타 정보를 기록하고, 저장
- ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease];
- [library writeImageToSavedPhotosAlbum:[image CGImage]
- metadata:tiffDic
- completionBlock:^(NSURL *newURL, NSError *error) {
- if (error) {
- NSLog(@"%@", [error localizedDescription]);
- } else {
- }
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement