Accessing Photos library

Anyone had any luck creating an application that allows the user to browse the Photos library and select one or more photos? I believe you have to use MLMediaLibrary to do this (but I have been known to be wrong. On many occasions).

I thought about making a plugin for this, but was not sure about interest.

And it would be 64-bit only.

64-bit would be fine (who even bothers with 32-bit, based on Apple’s deprecation thereof)

Of course, I’d have to pony up for your plugins…

Only if you don’t have a license…

And I would schedule a few hours to write it for you with an example project.

Do that and my money is yours…

There are several methods for accessing photos from a “Photos” library.

  1. The ‘Open’ dialog, if the user scrolls to the bottom of the left, they can access their photos there.
  2. MLMediaLibrary; which displays a floating window allow the user to drag and drop images from their photo library (returns the actual photo). I have working 64-Bit code for this.

These following functions are a pain.

  1. Drag and drop from Photos; it creates a “Promised file drop” which you have to accept and then wait for it to re-encode the images.
  2. Photos on High Sierra should have an export option, which would allow the user to select the photo in “Photos” and export it to your application.
  3. A Photos plugin.
  4. Reading the “Photos” library, which will get an application rejected from the App Store.

I cleaned up my code for the NSMediaLibraryBrowser and you can download it from the link below.

http://www.ohanaware.com/xojo/NSMediaLibraryBrowser.zip

NSMediaLibraryBrowserControllerMBS is also in MBS Plugins.

I’ll check the MediaLibrary classes.

[quote=376087:@Sam Rowlands]I cleaned up my code for the NSMediaLibraryBrowser and you can download it from the link below.

http://www.ohanaware.com/xojo/NSMediaLibraryBrowser.zip[/quote]

Sam, Perfect! Exactly what I needed.

Coming in on an old thread here, but this is very useful for me. Thanks to both Sam and Christian, as both of your solutions work here as advertised.

My use case might be different from others, in that I’m am ultimately uploading the dragged picture via FTP/SFTP. Everything works fine except that the upload list, derived from the actual dropped FolderItem, displays the gobbledygook unique filename that Photos puts on the originals, not the “real” filename that lives in the database and/or metadata. This is not a showstopper, but it would be nice to match the “real” filename that is displayed in the library browser. I’m afraid that the discrepancy would be disconcerting to the user.

This is new territory for me. I would appreciate getting pointed the right way, or being told I’m asking too much. I’m browsing Christian’s MediaLibrary documentation as I write this.