Reputation: 151
I am making a camera application.
Using UIImagePickerController, I can take a picture.
then I want to save this picture with Exif metadata.
I implemented save the picture with GPS metadata
using ALAssetsLibrary
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
[library writeImageToSavedPhotosAlbum:[image CGImage] metadata:metadata completionBlock:compBlock];
[library release];
I used that method, and metadata contains GPSDictionary.
Like this, I want to save Exif data that contains shutter speed, white balance, date time, and so on.
but I don't know how to get those data.
Is it possible to get those data from camera? (Not camera roll)
Upvotes: 2
Views: 3863
Reputation: 1291
The UIImagePickerController
doesn't give you the Camera's location. You have to
CLLocationManager
in the app. Initiate/delegate to self
startUpdatingLocation
.-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
,newLocation
.Now if you want to save the image to photo Library, you can use https://github.com/gpambrozio/GusUtils
More explanations can be found: http://blog.codecropper.com/2011/05/adding-metadata-to-ios-images-the-easy-way/
Upvotes: 1
Reputation: 124
See the AVCamDemo sample application from Apple. It shows how to register for updates when those values you mentioned change. But this uses an AVCaptureSession and AVCaptureDeviceInput to access these values. You then have to command the device to take a picture.
Upvotes: 0
Reputation: 6932
In this answer I posted.
You can obtain the files/asset's Exif info with the call
[asset metadata]
The reference I found is here sarofox.alasset-image-metadata The page also shows how to get individual properties....
Upvotes: 0