Write UIImage along with metadata (EXIF, GPS, TIFF) in iPhone’s Photo library

Apple has updated their article addressing this issue (Technical Q&A QA1622). If you’re using an older version of Xcode, you may still have the article that says, more or less, tough luck, you can’t do this without low-level parsing of the image data. https://developer.apple.com/library/ios/#qa/qa1622/_index.html I adapted the code there as follows: – (void) saveImage:(UIImage *)imageToSave … Read more

How to get an ALAsset URL from a PHAsset?

Create the assetURL by leveraging the localidentifier of the PHAsset. Example: PHAsset.localidentifier returns 91B1C271-C617-49CE-A074-E391BA7F843F/L0/001 Now take the 32 first characters to build the assetURL, like: assets-library://asset/asset.JPG?id=91B1C271-C617-49CE-A074-E391BA7F843F&ext=JPG You might change the extension JPG depending on the UTI of the asset (requestImageDataForAsset returns the UTI), but in my testing the extensions of the assetURL seems to be … Read more

tech