photolibrary

uiimagepickercontroller - get the name of the image selected from photo library

笑着哭i 提交于 2019-12-02 21:21:45
I am trying to upload the image from my iPhone/iPod touch to my online repository, I have successfully picked the image from Photo Album but i am facing one problem i want to know the name of the image such as image1.jpg or some thing like that. How i would know the name of the picked image. I guess knowing the exact image name would not be an issue rather getting a unique name for the picked image would solve your purpose so that you can upload the image on server and track it via its name. May be this can help you NSMutableString *imageName = [[[NSMutableString alloc] initWithCapacity:0]

Access to Camera and PhotoLibrary

╄→尐↘猪︶ㄣ 提交于 2019-12-02 20:56:05
问题 In my iOS app I have an ImageView and two Buttons for opening the camera and the photolibrary. When I click on one of the buttons the app closes. (I'm running the app on my device, not the simulator) What do I have to change in my code? class PhotoViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var ImageDisplay: UIImageView! @IBOutlet weak var libraryOutlet: UIButton! @IBOutlet weak var cameraOutlet: UIButton! override func

Access to Camera and PhotoLibrary

别来无恙 提交于 2019-12-02 09:21:29
In my iOS app I have an ImageView and two Buttons for opening the camera and the photolibrary. When I click on one of the buttons the app closes. (I'm running the app on my device, not the simulator) What do I have to change in my code? class PhotoViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var ImageDisplay: UIImageView! @IBOutlet weak var libraryOutlet: UIButton! @IBOutlet weak var cameraOutlet: UIButton! override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super

Email jpg created in app including metadata

倾然丶 夕夏残阳落幕 提交于 2019-11-30 10:36:50
I have successfully added metadata to a jpg created within the app and saved it to the Camera Roll using the writeImageToSavedPhotosAlbum: metadata: completionBlock: method. However I would also like the option of emailing this jpg with the metadata (such as location, exit, etc.). I use this to email: MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSData *myData = UIImageJPEGRepresentation(emailImage, 0.8); [picker addAttachmentData:myData mimeType:@"image/jpg" fileName:@"photo"]; However, this results in no metadata. When

Swift - how to get last taken 3 photos from photo library?

北城余情 提交于 2019-11-27 17:38:07
I need to get and show last taken 3 photos from photo library on viewDidload event without any clicks. After this step I should get other photos 3 by 3 when I scroll the scrollview. Do you know the proper way to do this with swift? Thanks. Here's a solution using the Photos framework available for devices iOS 8+ : import Photos class ViewController: UIViewController { var images:[UIImage] = [] func fetchPhotos () { // Sort the images by descending creation date and fetch the first 3 let fetchOptions = PHFetchOptions() fetchOptions.sortDescriptors = [NSSortDescriptor(key:"creationDate",

Delete a photo from the user's photo library?

六月ゝ 毕业季﹏ 提交于 2019-11-27 12:29:50
问题 Is there a way I can delete an image that is loaded into my app from a UIImagePickerController ? I want to be able to delete the image from the user's photo library when the user performs a specific action. I am prompting the user to choose a image from their library, then it gets loaded into my app at which point the app does some shnazzy animation, then actually deletes the image. Please help! 回答1: Yes we can delete a photo. We can use PHAssetChangeRequest for this operation. From Apple: A

Swift - how to get last taken 3 photos from photo library?

旧时模样 提交于 2019-11-26 22:35:33
问题 I need to get and show last taken 3 photos from photo library on viewDidload event without any clicks. After this step I should get other photos 3 by 3 when I scroll the scrollview. Do you know the proper way to do this with swift? Thanks. 回答1: Here's a solution using the Photos framework available for devices iOS 8+ : import Photos class ViewController: UIViewController { var images:[UIImage] = [] func fetchPhotos () { // Sort the images by descending creation date and fetch the first 3 let

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?

馋奶兔 提交于 2019-11-26 15:11:50
I'm saving a merged image to the iPhone photo library using: UIImageWriteToSavedPhotosAlbum(viewImage, self, @selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil); And getting the callback using: - (void) savedPhotoImage:(UIImage*)image didFinishSavingWithError:(NSError *)error contextInfo: (void *)contextInfo { NSLog(@"%@", [error localizedDescription]); NSLog(@"info: %@", contextInfo);} What I would like to get is the path for where the image has been saved, so I can add it to an array which will be used to call up a list of saved items elsewhere in the app. When I load the

Get all of the pictures from an iPhone photoLibrary in an array using AssetsLibrary framework?

烈酒焚心 提交于 2019-11-26 14:25:49
I want to get all of the pictures from photoLibrary. I would prefer a method or example that I can use directly. //View Controller header(.h) file.. #import <UIKit/UIKit.h> #include <AssetsLibrary/AssetsLibrary.h> @interface getPhotoLibViewController : UIViewController { ALAssetsLibrary *library; NSArray *imageArray; NSMutableArray *mutableArray; } -(void)allPhotosCollected:(NSArray*)imgArray; @end //implementation file declare global count variable as static int count=0; @implementation getPhotoLibViewController -(void)getAllPictures { imageArray=[[NSArray alloc] init]; mutableArray =[

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?

喜欢而已 提交于 2019-11-26 04:41:43
问题 I\'m saving a merged image to the iPhone photo library using: UIImageWriteToSavedPhotosAlbum(viewImage, self, @selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil); And getting the callback using: - (void) savedPhotoImage:(UIImage*)image didFinishSavingWithError:(NSError *)error contextInfo: (void *)contextInfo { NSLog(@\"%@\", [error localizedDescription]); NSLog(@\"info: %@\", contextInfo);} What I would like to get is the path for where the image has been saved, so I can