sandy
sandy

Reputation: 1072

Path and extension of image

I want to get the Path a of image of the photo albums from the iPhone device. and also i need the extension of that image with their name.

Upvotes: 1

Views: 1616

Answers (1)

sandy
sandy

Reputation: 1072

newFilePath = [NSHomeDirectory() 
    stringByAppendingPathComponent: textFieldNormalFile_name.text];
//newFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent: @"ChosenPic.jpg"];
imageData = UIImageJPEGRepresentation(img, 1.0);
if (imageData != nil) {
    NSLog(@"HERE [%@]", newFilePath);
    [imageData writeToFile:newFilePath atomically:YES];
}
image.image =[UIImage imageNamed:newFilePath];
NSLog(@"newFilePath:%@",newFilePath);
path.text =[NSString stringWithFormat:newFilePath];
NSLog(@"path.text :%@",path.text);

Upvotes: 1

Related Questions