Recent

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

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 2020
  • Former Delphi 1-7, 10.2 user
Re: Import images from Photo library
« Reply #1 on: August 06, 2021, 01:48:45 pm »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 2770
    • havefunsoft.com
Re: Import images from Photo library
« Reply #3 on: August 06, 2021, 03:47:09 pm »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 2020
  • 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.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 370
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