Converting AVCapturePhoto to UIImage loses its metadata

I am using AVCapturePhoto to capture image. In didFinishProcessingPhoto i am getting image data using fileDataRepresentation. But when i convert this data to UIImage, it loses most of its metadata.

I need to draw bezier path on UIImage and still maintain metadata.

Is there any way to do this.

Can't you save metaData separately and use those you need later ?

fileDataRepresentation contains its metadata. But UIImage class does't have metadata property. This is the reason.

You can get image source to keep maintain image's metadata.

CGImageSourceCreateWithData(::)

CGImageSourceCopyPropertiesAtIndex(::_:)

Converting AVCapturePhoto to UIImage loses its metadata
 
 
Q