Metadata on UIImage not using the camera roll - Swift - ios

Simply, I am trying to save/add GPS metadata into a UIImage which is then stored in a custom folder. I do not want this image to appear in the camera roll.
It appears that the "Photos Framework" won't help as this requires the image being added to the camera roll.
Other code I have seen online uses a lot of unmanaged code and so, this doesn't feel like a very "swift" way of doing things.
Does anyone have any resources that shows how to modify the metadata of a UIImage? or am I looking at this incorrectly.
Thanks

Related

How to get image from camera roll by name/identifier in Swift

in my app I'm taking a picture and save it in camera roll by:
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
Later in another screen, I want to display it to the user.
As I don't want to store the whole picture, is there any possibility to load an image from camera roll using the image name or an identifier? (And of course set the image name or saving the identifier when saving the picture)
Any help would be appreciated!
As per my knowledge it is not possible to load an image directly from camera roll using name/identifier.
For your requirement it is better to save your image with a name in document directory instead of saving it in camera roll, then load it with the same name where ever you want to use it.
For sample code refer #Dharmesh Kheni's answer in below link.
Get image name UIImagePickerController in Swift

How to preview automatically edited image after picking with UIImagePickerController

I my app users can take and save photos, but before I save them on disk, I have to compress and downscale them. Is it possible to show automatically edited image in a standard preview screen right after user captured the image with UIImagePickerController? Or should I build my own camera with AVFoundation? If so, could anyone suggest some lightweight opensource camera for my purposes?
You're going to have to build your own solution with AVCaptureSession, which is not hard, since you more than likely will want to keep the original photo in a temp file, compress it, show it on a custom view with an image view in it and then ask the user if they want to save it or not.
Here's Apple's Docs but there are plenty tutorials on how to do this

How to attach metadata to UIImage without saving to library

I have a function capturing few images and add them into NSMutableArray rawImages of UIImage. Then I pass this rawImages to other object to apply some image processing on the images in the array. In the image processing, I need to retrieve the exposure time from EXIF metadata.
I have been able to get the EXIF from CMSampleBuffer when capturing using AVFoundation. Is there a way to attach this EXIF to the rawImages array?
(PS: I know that one can save it into library and then read the images from library along with the metadata, but I don't want that)
Any help is much appreciated! THANKS!

ALAssest of an Image taken from Camera without saving it

Hi I was wondering if theres a way to extract ALAsset of an image taken from Camera but without saving it...
Ive come across various example that used writeImageToSavedPhotosAlbum and then fetched the ALAssest, but i dont deem it necessary to save the image in the camera roll, was just wondering if this could be done otherwise
No ALAssest exists until the image has been successfully saved to the image library. Until then you just have a UIImage that has come from the picker. There is no mandate that the image needs to be saved into the library and any decision about whether you want to save the image should be based on what the app tells the user and if the user would naturally expect to find the image in the library after taking / saving it in the app.

iOS UIImagePickerController vs AV foundation: looking to implement image capture with overlay, which is best?

I'm looking to build functionality into an iOS app that allows the user to take a picture or grab one from their library, apply an overlay to the image, then save the image with the overlay. There seems to be two ways to do image capture, using UIImagePickerController or AV foundation.
From what I've read UIImagePickerController seems to be easy to implement but allows for less customizability. Is this something I should use to do this? Or should I be looking into AV Foundation? New to this and looking for some tips or any links to tutorials that may help. Thanks!
UIImage picker is much more simpler, but will give you less options. AV Foundation is more complex by my experience, I have been on a similar situation like you for the past 2 weeks and have experiminted with both. For overlay, I feel UIImage picker is easy since you can just override the Void CGrect method and get it done, However for complex things like cropping or capturing a part of the image clicker, AVfoundation works better. Best Wishes!!

Resources