0
그래서이 파일은 간단해야합니다. 편집 한 UIImage를 같은 파일에 저장하는 데 문제가 있습니다. 대신, 새로운 것을 생성합니다.편집 된 UIImage의 변경 사항을 같은 파일에 저장하십시오.
코드 : 내가 잘못 뭐하는 거지
// Get current photo
id<MWPhoto> currentPhoto = [self photoAtIndex:_currentPageIndex];
// Get current image object from photo
UIImage *currentImage = [self imageForPhoto:(currentPhoto)];
// Mirror it
currentImage = [UIImage imageWithCGImage:currentImage.CGImage
scale:currentImage.scale
orientation:UIImageOrientationUpMirrored];
// Get NSData from image
NSData *imageData = UIImageJPEGRepresentation(currentImage, 1);
// Create ALAsssetsLibrary to save data to photos
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library writeImageDataToSavedPhotosAlbum:imageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
if (error != nil) {
NSLog(@"There was an error saving image");
} else {
NSLog(@"Image should be saved");
}
}];
어떤 생각?
은 또한 UIImageWriteToSavedPhotosAlbum(currentImage, nil, nil, nil);
하지만 여전히 같은 시도했다.