From 24d5ecd1196bc1f055abcc1bc9a767dc62644b4b Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 5 May 2024 21:13:34 +0200 Subject: [PATCH] Shortcuts: Fix image --- Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift index 8c049832..3eb630ec 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift @@ -752,7 +752,7 @@ public extension StatusEditor { for url in urls { let compressor = Compressor() - + _ = url.startAccessingSecurityScopedResource() if let compressedData = await compressor.compressImageFrom(url: url), let image = UIImage(data: compressedData) { @@ -765,6 +765,8 @@ public extension StatusEditor { error: nil )) } + + url.stopAccessingSecurityScopedResource() } return containers