iphone - Retrieve the url of an image taken on the fly and saved in the gallery, how? -
i allow user choose image gallery or take photo camera. save image path in both cases can use display image in second moment.
when user select image gallery, can use
- (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { if([[info valueforkey:@"uiimagepickercontrollermediatype"] isequaltostring:@"public.image"]) { nsurl *imageurl = [info valueforkey:@"uiimagepickercontrollerreferenceurl"]; }
}
instead, if user takes photo on fly, save in photo roll with:
uiimage *image = [info objectforkey:@"uiimagepickercontrolleroriginalimage"]; uiimagewritetosavedphotosalbum(image, self, @selector(image:didfinishsavingwitherror:contextinfo:), nil);
after saving it, retrieve corresponding nsurl user had selected it.
how do?
edit
my problem isn't image chosen gallery. succeed in retrieving url using uiimagepickercontrollerreferenceurl path. problem when user takes photo camera. can write in photo roll, should find way automatically select such
- (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info
is called again , can use uiimagepickercontrollerreferenceurl key retrieve corresponding url.
Comments
Post a Comment