2
votes

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)

3

3 Answers

1
votes

The UIImagePickerController doesn't give you the Camera's location. You have to

  • Add CLLocationManager in the app. Initiate/delegate to self
  • Call startUpdatingLocation.
  • In -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation,
  • Get your location from 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/

0
votes

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

0
votes

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.