satish
satish

Reputation:

How to get names of Photos in PhotoLibrary in iPhone?

I need to get the information about photos like the path of the image, name and so on... in iPhone.

Is there a way to get this programmatically using SDKs done on non-jailbroken iPhone?

Upvotes: 2

Views: 996

Answers (2)

drvdijk
drvdijk

Reputation: 5554

I'm afraid you can't programmatically on a non-jailbroken iPhone. I wouldn't know if you can on a jailbroken phone, but the non-jailbroken phone only lets you pick images with the UIImagePickerController class.

As you probably already know, the UIImagePickerControllerDelegate gives you an UIImage and optionally an NSDictionary with editing info (containing the crop rectangle and the original image). You don't know which image from the library it was (if it wasn't the camera itself).

Saving images is done with UIKit UIImageWriteToSavedPhotosAlbum method, which only lets you specify the image and a callback method when the image is written. After this method is finished (and the callback is done), you don't know where in the photos album the image is saved.

So unfortunately, the answer basically is: if you want information other than size, then no.

Upvotes: 2

Mick F
Mick F

Reputation: 7439

I'm interested in this subject too.

So far, I've been using the AV Foundation Framework (available since iOS 4.0) and got access to the pictures via ALAssets. You can get an image representation of the photo, the local URL to the pictures on the device or meta information about them (like the locations they were taken at for instance) but I can't find how to get the name and description of your pictures, as you can set them in iPhoto, as shown in the following screenshot (cf. red square : in my example, i'd like to get "MyPhotoName" and "MyDescription" strings).

So I think the partial answer to your question is: "use the AV Foundation Framework", and the other part is: "you can't access to some information related to your photos".

  • Can anybody confirm this is impossible to get the name and description information via the AV Foundation Framework?
  • Is there any other way to get it?

enter image description here

Upvotes: 0

Related Questions