Path and extension of image

后端 未结 1 1716
臣服心动
臣服心动 2021-01-07 08:51

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.

相关标签:
1条回答
  • 2021-01-07 09:31
    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);
    
    0 讨论(0)
提交回复
热议问题