Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Save changed image back to Photo Library on iOS (overwrite original)

$
0
0

Hi, this is my first post here :)

I'm building an application which allows user to edit images. The app is written in Xamarin forms.
One of the use case is all about changing image contents (e.g. apply blur, or exif metadata change).
As a result, after edit is done, user should be able to save the modified file.

So, the execution path is the following:
Save button => Encode (common implementation for all platforms) => byte array containing JPEG-encoded changed image.
=> PhotoLibraryWriter (speficic for each platform).

The problem is that I can't find a way to update changes to picked photo from Photo Library on iOS.
I've found some examples for iOS written in Objective-C, but these examples are not of much help.
The best thing I found is a tutorial on MSDN (docs.microsoft.com/en-us/xamarin/ios/platform/photokit) showing how to
implement a similar thing. The difference is however that I already have binary ready to save. I've been struggling to adjust
the example to suit my needs, but without success.

So, to sum up - I need a method which will get as input parameters:

  • binary (it will always be already JPEG-encoded image)
  • originalImgLocation NSUrl

The method should save the binary so that the image gets updated in the photo library.

(Note: saving image to photo library as brand new item is dead easy, but I need to update existing image. Probably it also may turn out easy, but now it is not for me)

Thanks in advance !
Michal


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>