Recent

Author Topic: Import images from Photo library  (Read 5709 times)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Import images from Photo library
« on: August 06, 2021, 01:43:47 pm »
Hi,

Is there any example how I can show a system window to import selected image(s) from Photo library on Mac?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1623
  • Former Delphi 1-7, 10.2 user
Re: Import images from Photo library
« Reply #1 on: August 06, 2021, 01:48:45 pm »
Lazarus 2.3 + FPC 3.3.1 2021-10-19 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 + FPC 3.3.1 2021-09-21 macOS 11.6 aarch64 Xcode 13
Lazarus 2.3 2021-08-11 FPC 3.2.2 FreeBSD 13.0 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Import images from Photo library
« Reply #2 on: August 06, 2021, 02:54:17 pm »
Thanks, but regrettably it doesn't include my case. I need to copy selected images from Photo library to my app.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2712
    • havefunsoft.com
Re: Import images from Photo library
« Reply #3 on: August 06, 2021, 03:47:09 pm »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Import images from Photo library
« Reply #4 on: August 06, 2021, 05:12:32 pm »
Thanks, yes, it seems that I need PhotoKit.

Does Lazarus include some component to implement this feature?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1623
  • Former Delphi 1-7, 10.2 user
Re: Import images from Photo library
« Reply #5 on: August 07, 2021, 02:44:38 am »
Photokit requires macOS 10.11+ but the FPC Cocoa headers are only up to 10.10.
Lazarus 2.3 + FPC 3.3.1 2021-10-19 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 + FPC 3.3.1 2021-09-21 macOS 11.6 aarch64 Xcode 13
Lazarus 2.3 2021-08-11 FPC 3.2.2 FreeBSD 13.0 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Import images from Photo library
« Reply #6 on: August 08, 2021, 08:13:53 pm »
Thanks, I hope that future FPC 3.4.0 will be based on SDK 10.11 or newer.

Ryan Joseph

  • Newbie
  • Posts: 4
Re: Import images from Photo library
« Reply #7 on: September 06, 2021, 04:47:42 pm »
Igor, the headers are parsed now so you can try using the Photos frameworks now. https://forum.lazarus.freepascal.org/index.php/topic,56171.0.html

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 349
Re: Import images from Photo library
« Reply #8 on: September 07, 2021, 05:38:13 pm »
Hi Ryan,

Many thanks! I'll try these headers with Photo library tomorrow on my M1 Mac.

 

TinyPortal © 2005-2018