iphone store image in application along with EXIF data - iphone

This is kind of continuation of this thread
iphone how to go to the image gallery after taking photo through Xcode
I am following the method suggested by Saurabh(the link given in the comment). I just want to know if the EXIF data will be retained if I follow this method(storing the image in the application)

The short answer, yes, it will be retained.

Related

Can I detect if an imported ALAsset photo was taken via screenshot?

I have an imagePickerController that is used for importing photos from library into my app.
When in ALAssetsLibraryAssetForURLResultBlock, I'm trying to find out if the ALAsset I've got in the block is a photo taken as a screen-shot or is it a "genuine" photo, taken by the camera.
I've tried to go through the ALAsset's metadata dictionaries but couldn't find any flag / indication that might fit.
Anyone have any ideas?
For screenshot, its UTI is always a "public.png" and same size as screen (be sure you have multiply [UIScreen scale] on screen bounds width and height), just need to check these 2 metadata, you can easily identify screenshot.
Add MetaData to UIImage while saving to Photo Library. Same metadata of UIImage can be used to know if its screenshot or not.
Refer Save_Photo_to_Album_with_Metadata
Well, I was researching and experimenting .. and the closest solution I've found is based on the fact that iPhone screenshots don't yield EXIF records (while all other generated photos do generate them).
Therefore, once a photo is selected in the picker, I'm checking if the photo's metadata consists an EXIF record and if it doesn't - I conclude that the photo was screenshot.
I found it's the "as good as it gets" solution for now, although it's not an official one.
Cheers.

Detecting image location of the picture in iPhone

I am working on a camera app in which the pictures I take should store the location as to where they were taken. So maybe after a while, if I want to know where a particular picture was taken, I should click on a button, say above my photo album, which should re-direct me to a mapview. There, it should show the places where i've taken all my pictures, with an album for each place.
Any idea on how to make this work?
here are some links which is related to your question.
Get Exif data from UIImage
UIImagePickerController and extracting EXIF data from existing photos
Add MetaData to UIImage. Same metadata of UIImage can be used to know images's location.
Refer Save_Photo_to_Album_with_Metadata

iPhone:Image API in iPhone

Is there any Image API available in iPhone?? so using that API I can develop a functionality to get all information of that photo in iPhone.
Thanks in advance.
You need to look at the ImageIO framework
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/ImageIOGuide/imageio_intro/ikpg_intro.html#//apple_ref/doc/uid/TP40005462
yes, since IOS4 http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAsset_Class/Reference/Reference.html
depending on what you want exactly, this deals with the camera output.
The question is very fuzzy: please make it more exact.
if you want to get information about the size of the image, orientation, type etc, you can use the UIImage and CGImage classes which will give you information about the image itself. (size, colors, pixel size etc)..
If you want to get or access pictures in the Photos app of the iphONE, ALAssetsLibrary is what you need to read about - you can save and get images and videos from the iPhone's native album.
If you want the metadata saved alongside each image - like the location it picture was taken, the lens size, date taken etc.. - I am unsure how one gets that data.

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?
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.
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?

iPhone - access location information from a photo

Is it possible, in an iPhone app, to extract location information (geocode, I suppose it's called) from a photo taken with the iPhone camera?
If there is no API call to do it, is there any known way to parse the bytes of data to extract the information? Something I can roll on my own?
Unfortunately no.
The problem is thus;
A jpeg file consists of several parts. For this question the ones we are interested in are the image data and the exif data. The image data is the picture and the exif data are where things like geocoding, shutter speed, camera type and so on are stored.
A UIImage (and CGImage) only contain image data, no tags.
When the image picker selects an image (either from the library or the camera) it returns a UIImage, not a jpeg. This UIImage is created from the jpeg image data, but the exif data in the jpeg is discarded.
This means this data is not in the UIImage at all and thus is not accessible.
I think the selected answer is wrong, actually. Well, not wrong. Everything it said is correct, but there is a way around that limitation.
UIImagePickerController passes a dictionary along with the UIImage it returns. One of the keys is UIImagePickerControllerMediaURL which is "the filesystem URL for the movie". However, as noted here in newer iOS versions it returns a url for images as well. Couple that with the exif library mentioned by #Jasper and you might be able to pull geotags out of photos.
I haven't tried this method, but as #tomtaylor mentioned, this has to be possible somehow, as there are a few apps that do it. (e.g. Lab).