I am using image picker to pick image from gallery in iPhone device. I have to save those images in the same name that is in the gallery. I don want to name it different after picking image. I tried printing the info dictionary after picking image. Its gives image,url and path and type.. but how to get the actual name of the image any idea. Following is what i get in didFinish
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSLog(@"Selected image info: %@",info);
}
this prints
Selected image info : (
{
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x617d390>";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=1000000089&ext=JPG";
}
)
my question is any way to get the actual name from the above.
Using the AssetsLibrary framework, you can get the referenceURL from the info dictionary and fetch the asset. Something like this: