我的应用程序使用 didFinishPickingMediaWithInfo 拍照,我想将其保存在相机胶卷中
UIImage *orgImage=[[UIImage alloc]init];
orgImage = (UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage];
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera)
{
UIImageWriteToSavedPhotosAlbum(orgImage, nil, nil, nil);}
我保存完整但是当我从相机胶卷元数据中获取信息时相同的图像没有 dateTimeOriginal
/ Camera Roll
if ([info valueForKey:UIImagePickerControllerReferenceURL] != nil)
{
NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
if(imageURL)
{
ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
[assetslibrary assetForURL:imageURL
resultBlock:^(ALAsset *myasset)
{
ALAssetRepresentation *representation = [myasset defaultRepresentation];
NSDictionary *metadata = representation.metadata;
NSDictionary *exifData = [metadata objectForKey:@"{Exif}"];
NSString *dateTimeOriginal = [exifData objectForKey:@"DateTimeOriginal"];
}
failureBlock:^(NSError *myerror)
{
// Error
}];
}
}