How to write exif data with GPS location in uiimage on iPhone?

I want to write exif data with GPS location in uiimage on iPhone. For this, I searched googled and I found libiPhone-exif.a libarary for the iPhone, but it does not work for the xcode armv7 project. I also tried using the ALAssetsLibrary functions suggested by the following link
Get Exif Data from UIImage - UIImagePickerController

I can get exif data from UIImagePickerController using the above code, and I want to write it to UIIMage using NSData. And I also want to know that exif data will be saved after UIImage compression using the following statement,

NSData *imgData = UIImageJPEGRepresentation(img,1.0);

Please help me write exif data with GPS location in uiimage on iPhone

+4
source share
2 answers

Some exif data (for example, GPS location) will be lost when you try to turn NSData into UIImage, because the UIImage class does not contain this information. You can only get from NSData.

0
source

I had the same problem with you in my previous project, you cannot record GPS information in UIImage, you need to use NSData or save image.jpg or png somewhere to store GPS information.

0
source

Source: https://habr.com/ru/post/1616473/


All Articles