Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

macos: implement preview provider for macos 12 and up

Ivan Yossibd5b2e819731
diff --git a/krita/integration/CMakeLists.txt b/krita/integration/CMakeLists.txt
index dc10f7c5c1..c0be4acf67 100644
--- a/krita/integration/CMakeLists.txt
+++ b/krita/integration/CMakeLists.txt
@@ -10,6 +10,7 @@ add_custom_target( kritaintegration ALL xcodebuild
-target kritaquicklook
-target kritaspotlight
-target krita-thumbnailer
+ -target krita-preview
-configuration Release COMMENT build all macOS plugins
)
@@ -19,4 +20,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/Release/kritaspotlight.mdimp
# TODO fix and reenable - https://bugs.kde.org/show_bug.cgi?id=430553
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/Release/krita-thumbnailer.appex DESTINATION ${KDE_INSTALL_PLUGINDIR})
+
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/Release/krita-preview.appex DESTINATION ${KDE_INSTALL_PLUGINDIR})
endif(APPLE)
diff --git a/krita/integration/integration.xcodeproj/project.pbxproj b/krita/integration/integration.xcodeproj/project.pbxproj
index 8558a0cae8..fb73793654 100644
--- a/krita/integration/integration.xcodeproj/project.pbxproj
+++ b/krita/integration/integration.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 70;
+ objectVersion = 74;
objects = {
/* Begin PBXBuildFile section */
@@ -14,6 +14,13 @@
114946602EA6B34D00515C4C /* libunziptask.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D505D725608693005AFC55 /* libunziptask.a */; };
114946612EA6B34D00515C4C /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62A25619404003662DB /* Quartz.framework */; };
1149466C2EA6BA8900515C4C /* krita-thumbnailer_helper.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 114946662EA6B34D00515C4C /* krita-thumbnailer_helper.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 114946862EA6C47200515C4C /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62A25619404003662DB /* Quartz.framework */; };
+ 114946972EA6C49700515C4C /* libunziptask.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D505D725608693005AFC55 /* libunziptask.a */; };
+ 1149469A2EA6C49F00515C4C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 114946412EA3FACB00515C4C /* AppKit.framework */; };
+ 114946A12EA7079600515C4C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 114946412EA3FACB00515C4C /* AppKit.framework */; };
+ 114946A22EA7079600515C4C /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62A25619404003662DB /* Quartz.framework */; };
+ 114946A32EA7079600515C4C /* libunziptask.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D505D725608693005AFC55 /* libunziptask.a */; };
+ 114946AB2EA7080200515C4C /* krita-preview_helper.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 114946A82EA7079600515C4C /* krita-preview_helper.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
84B7B62925619404003662DB /* QuickLookThumbnailing.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62825619404003662DB /* QuickLookThumbnailing.framework */; };
84B7B62B25619404003662DB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62A25619404003662DB /* Quartz.framework */; };
84B7B62E25619404003662DB /* ThumbnailProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B7B62D25619404003662DB /* ThumbnailProvider.swift */; };
@@ -48,6 +55,27 @@
remoteGlobalIDString = 84D505D625608693005AFC55;
remoteInfo = unziptask;
};
+ 114946902EA6C47200515C4C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 114946842EA6C47200515C4C;
+ remoteInfo = "krita-preview";
+ };
+ 114946982EA6C49700515C4C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 84D505D625608693005AFC55;
+ remoteInfo = unziptask;
+ };
+ 1149469E2EA7079600515C4C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 84D505D625608693005AFC55;
+ remoteInfo = unziptask;
+ };
84B7B63525619534003662DB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
@@ -78,6 +106,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
+ 114946AB2EA7080200515C4C /* krita-preview_helper.appex in Embed App Extensions */,
1149466C2EA6BA8900515C4C /* krita-thumbnailer_helper.appex in Embed App Extensions */,
);
name = "Embed App Extensions";
@@ -110,6 +139,9 @@
114946472EA5593D00515C4C /* previewHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = previewHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
114946662EA6B34D00515C4C /* krita-thumbnailer_helper.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "krita-thumbnailer_helper.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
114946672EA6B34E00515C4C /* krita_thumb_helper.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = krita_thumb_helper.plist; path = "/Users/daedalus/developer/krita/repos/cibuild/krita/krita/integration/krita-thumbnailer_helper/krita_thumb_helper.plist"; sourceTree = "<absolute>"; };
+ 114946852EA6C47200515C4C /* krita-preview.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "krita-preview.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 114946A82EA7079600515C4C /* krita-preview_helper.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "krita-preview_helper.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 114946AA2EA7079600515C4C /* krita-preview-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "krita-preview-Info.plist"; path = "/Users/daedalus/developer/krita/repos/cibuild/krita/krita/integration/krita-preview_helper/krita-preview-Info.plist"; sourceTree = "<absolute>"; };
84A059912560A72500E4EAFD /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
84A059942560A75000E4EAFD /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
84B7B62725619404003662DB /* krita-thumbnailer.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "krita-thumbnailer.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -145,10 +177,29 @@
);
target = 114946462EA5593D00515C4C /* previewHelper */;
};
+ 114946962EA6C47200515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
+ isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
+ membershipExceptions = (
+ /Localized/PreviewViewController.xib,
+ Info.plist,
+ PreviewViewController.swift,
+ );
+ target = 114946842EA6C47200515C4C /* krita-preview */;
+ };
+ 114946A92EA7079600515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
+ isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
+ membershipExceptions = (
+ /Localized/PreviewViewController.xib,
+ Info.plist,
+ PreviewViewController.swift,
+ );
+ target = 1149469C2EA7079600515C4C /* krita-preview_helper */;
+ };
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
114946482EA5593D00515C4C /* previewHelper */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (114946532EA559CB00515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = previewHelper; sourceTree = "<group>"; };
+ 114946872EA6C47200515C4C /* krita-preview */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (114946962EA6C47200515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, 114946A92EA7079600515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = "krita-preview"; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
@@ -170,6 +221,26 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 114946822EA6C47200515C4C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1149469A2EA6C49F00515C4C /* AppKit.framework in Frameworks */,
+ 114946862EA6C47200515C4C /* Quartz.framework in Frameworks */,
+ 114946972EA6C49700515C4C /* libunziptask.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 114946A02EA7079600515C4C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 114946A12EA7079600515C4C /* AppKit.framework in Frameworks */,
+ 114946A22EA7079600515C4C /* Quartz.framework in Frameworks */,
+ 114946A32EA7079600515C4C /* libunziptask.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62425619404003662DB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -224,6 +295,14 @@
path = common;
sourceTree = "<group>";
};
+ 114946AC2EA7086800515C4C /* krita-preview_helper */ = {
+ isa = PBXGroup;
+ children = (
+ 114946AA2EA7079600515C4C /* krita-preview-Info.plist */,
+ );
+ path = "krita-preview_helper";
+ sourceTree = "<group>";
+ };
84A059902560A72500E4EAFD /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -257,6 +336,7 @@
84D650EF256036F000CC2E75 = {
isa = PBXGroup;
children = (
+ 114946AC2EA7086800515C4C /* krita-preview_helper */,
114946692EA6B4D900515C4C /* common */,
114946682EA6B42B00515C4C /* krita-thumbnailer_helper */,
84D505AC2560726A005AFC55 /* unzipTask */,
@@ -265,6 +345,7 @@
84D651182560371600CC2E75 /* spotlight */,
84B7B62C25619404003662DB /* krita-thumbnailer */,
114946482EA5593D00515C4C /* previewHelper */,
+ 114946872EA6C47200515C4C /* krita-preview */,
84D650F9256036F000CC2E75 /* Products */,
84A059902560A72500E4EAFD /* Frameworks */,
);
@@ -279,6 +360,8 @@
84B7B62725619404003662DB /* krita-thumbnailer.appex */,
114946472EA5593D00515C4C /* previewHelper.app */,
114946662EA6B34D00515C4C /* krita-thumbnailer_helper.appex */,
+ 114946852EA6C47200515C4C /* krita-preview.appex */,
+ 114946A82EA7079600515C4C /* krita-preview_helper.appex */,
);
name = Products;
sourceTree = "<group>";
@@ -374,6 +457,7 @@
);
dependencies = (
114946552EA561DD00515C4C /* PBXTargetDependency */,
+ 114946912EA6C47200515C4C /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
114946482EA5593D00515C4C /* previewHelper */,
@@ -403,6 +487,52 @@
productReference = 114946662EA6B34D00515C4C /* krita-thumbnailer_helper.appex */;
productType = "com.apple.product-type.app-extension";
};
+ 114946842EA6C47200515C4C /* krita-preview */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 114946932EA6C47200515C4C /* Build configuration list for PBXNativeTarget "krita-preview" */;
+ buildPhases = (
+ 114946812EA6C47200515C4C /* Sources */,
+ 114946822EA6C47200515C4C /* Frameworks */,
+ 114946832EA6C47200515C4C /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 114946992EA6C49700515C4C /* PBXTargetDependency */,
+ );
+ fileSystemSynchronizedGroups = (
+ 114946872EA6C47200515C4C /* krita-preview */,
+ );
+ name = "krita-preview";
+ packageProductDependencies = (
+ );
+ productName = "krita-preview";
+ productReference = 114946852EA6C47200515C4C /* krita-preview.appex */;
+ productType = "com.apple.product-type.app-extension";
+ };
+ 1149469C2EA7079600515C4C /* krita-preview_helper */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 114946A52EA7079600515C4C /* Build configuration list for PBXNativeTarget "krita-preview_helper" */;
+ buildPhases = (
+ 1149469F2EA7079600515C4C /* Sources */,
+ 114946A02EA7079600515C4C /* Frameworks */,
+ 114946A42EA7079600515C4C /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 1149469D2EA7079600515C4C /* PBXTargetDependency */,
+ );
+ fileSystemSynchronizedGroups = (
+ 114946872EA6C47200515C4C /* krita-preview */,
+ );
+ name = "krita-preview_helper";
+ packageProductDependencies = (
+ );
+ productName = "krita-preview";
+ productReference = 114946A82EA7079600515C4C /* krita-preview_helper.appex */;
+ productType = "com.apple.product-type.app-extension";
+ };
84B7B62625619404003662DB /* krita-thumbnailer */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84B7B63325619404003662DB /* Build configuration list for PBXNativeTarget "krita-thumbnailer" */;
@@ -492,6 +622,9 @@
114946462EA5593D00515C4C = {
CreatedOnToolsVersion = 26.0.1;
};
+ 114946842EA6C47200515C4C = {
+ CreatedOnToolsVersion = 26.0.1;
+ };
84B7B62625619404003662DB = {
CreatedOnToolsVersion = 11.3.1;
LastSwiftMigration = 1130;
@@ -508,7 +641,6 @@
};
};
buildConfigurationList = 84D650F3256036F000CC2E75 /* Build configuration list for PBXProject "integration" */;
- compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@@ -516,6 +648,7 @@
Base,
);
mainGroup = 84D650EF256036F000CC2E75;
+ preferredProjectObjectVersion = 50;
productRefGroup = 84D650F9256036F000CC2E75 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -526,6 +659,8 @@
84B7B62625619404003662DB /* krita-thumbnailer */,
114946462EA5593D00515C4C /* previewHelper */,
114946582EA6B34D00515C4C /* krita-thumbnailer_helper */,
+ 114946842EA6C47200515C4C /* krita-preview */,
+ 1149469C2EA7079600515C4C /* krita-preview_helper */,
);
};
/* End PBXProject section */
@@ -545,6 +680,20 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 114946832EA6C47200515C4C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 114946A42EA7079600515C4C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62525619404003662DB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -584,6 +733,20 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 114946812EA6C47200515C4C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1149469F2EA7079600515C4C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62325619404003662DB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -634,6 +797,21 @@
target = 84D505D625608693005AFC55 /* unziptask */;
targetProxy = 1149465A2EA6B34D00515C4C /* PBXContainerItemProxy */;
};
+ 114946912EA6C47200515C4C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 114946842EA6C47200515C4C /* krita-preview */;
+ targetProxy = 114946902EA6C47200515C4C /* PBXContainerItemProxy */;
+ };
+ 114946992EA6C49700515C4C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 84D505D625608693005AFC55 /* unziptask */;
+ targetProxy = 114946982EA6C49700515C4C /* PBXContainerItemProxy */;
+ };
+ 1149469D2EA7079600515C4C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 84D505D625608693005AFC55 /* unziptask */;
+ targetProxy = 1149469E2EA7079600515C4C /* PBXContainerItemProxy */;
+ };
84B7B63625619534003662DB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84D505D625608693005AFC55 /* unziptask */;
@@ -778,6 +956,162 @@
};
name = Release;
};
+ 114946942EA6C47200515C4C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = common/appex_sandbox.entitlements;
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "krita-preview/Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "krita-preview";
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.krita.krita-preview";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "common/unziptask-Bridging-Header.h";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 114946952EA6C47200515C4C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = common/appex_sandbox.entitlements;
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "krita-preview/Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "krita-preview";
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.krita.krita-preview";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "common/unziptask-Bridging-Header.h";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+ 114946A62EA7079600515C4C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = common/appex_sandbox.entitlements;
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "krita-preview_helper/krita-preview-Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "krita-preview";
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.krita.previewHelper.krita-preview";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "common/unziptask-Bridging-Header.h";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 114946A72EA7079600515C4C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = common/appex_sandbox.entitlements;
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "krita-preview_helper/krita-preview-Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "krita-preview";
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.krita.previewHelper.krita-preview";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "common/unziptask-Bridging-Header.h";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
84B7B63125619404003662DB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1060,6 +1394,24 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ 114946932EA6C47200515C4C /* Build configuration list for PBXNativeTarget "krita-preview" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 114946942EA6C47200515C4C /* Debug */,
+ 114946952EA6C47200515C4C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 114946A52EA7079600515C4C /* Build configuration list for PBXNativeTarget "krita-preview_helper" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 114946A62EA7079600515C4C /* Debug */,
+ 114946A72EA7079600515C4C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
84B7B63325619404003662DB /* Build configuration list for PBXNativeTarget "krita-thumbnailer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview.xcscheme b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview.xcscheme
new file mode 100644
index 0000000000..2d7eab28ca
--- /dev/null
+++ b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview.xcscheme
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "2600"
+ wasCreatedForAppExtension = "YES"
+ version = "1.7">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES"
+ buildArchitectures = "Automatic">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946842EA6C47200515C4C"
+ BuildableName = "krita-preview.appex"
+ BlueprintName = "krita-preview"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ shouldAutocreateTestPlan = "YES">
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = ""
+ selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES"
+ askForAppToLaunch = "Yes"
+ launchAutomaticallySubstyle = "2">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview_helper.xcscheme b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview_helper.xcscheme
new file mode 100644
index 0000000000..161e223733
--- /dev/null
+++ b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/krita-preview_helper.xcscheme
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "2600"
+ version = "2.0">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES"
+ buildArchitectures = "Automatic">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1149469C2EA7079600515C4C"
+ BuildableName = "krita-preview_helper.appex"
+ BlueprintName = "krita-preview_helper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ shouldAutocreateTestPlan = "YES">
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = ""
+ selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+ launchStyle = "0"
+ askForAppToLaunch = "Yes"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES"
+ launchAutomaticallySubstyle = "2">
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES"
+ askForAppToLaunch = "Yes"
+ launchAutomaticallySubstyle = "2">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1149469C2EA7079600515C4C"
+ BuildableName = "krita-preview_helper.appex"
+ BlueprintName = "krita-preview_helper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/previewHelper.xcscheme b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/previewHelper.xcscheme
new file mode 100644
index 0000000000..a805b669e7
--- /dev/null
+++ b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/previewHelper.xcscheme
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "2600"
+ version = "1.7">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES"
+ buildArchitectures = "Automatic">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ shouldAutocreateTestPlan = "YES">
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "114946462EA5593D00515C4C"
+ BuildableName = "previewHelper.app"
+ BlueprintName = "previewHelper"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/krita/integration/krita-preview/Base.lproj/PreviewViewController.xib b/krita/integration/krita-preview/Base.lproj/PreviewViewController.xib
new file mode 100644
index 0000000000..d8dd0f3f8c
--- /dev/null
+++ b/krita/integration/krita-preview/Base.lproj/PreviewViewController.xib
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+ <dependencies>
+ <deployment identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="PreviewViewController" customModuleProvider="target">
+ <connections>
+ <outlet property="view" destination="c22-O7-iKe" id="NRM-P4-wb6"/>
+ </connections>
+ </customObject>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+ <customView id="c22-O7-iKe" userLabel="Preview View">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ </customView>
+ </objects>
+</document>
diff --git a/krita/integration/krita-preview/Info.plist b/krita/integration/krita-preview/Info.plist
new file mode 100644
index 0000000000..c9590968fb
--- /dev/null
+++ b/krita/integration/krita-preview/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSExtension</key>
+ <dict>
+ <key>NSExtensionAttributes</key>
+ <dict>
+ <key>QLIsDataBasedPreview</key>
+ <true/>
+ <key>QLSupportedContentTypes</key>
+ <array>
+ <string>org.krita.kra</string>
+ </array>
+ <key>QLSupportsSearchableItems</key>
+ <false/>
+ </dict>
+ <key>NSExtensionPointIdentifier</key>
+ <string>com.apple.quicklook.preview</string>
+ <key>NSExtensionPrincipalClass</key>
+ <string>$(PRODUCT_MODULE_NAME).PreviewProvider</string>
+ </dict>
+</dict>
+</plist>
diff --git a/krita/integration/krita-preview/PreviewProvider.swift b/krita/integration/krita-preview/PreviewProvider.swift
new file mode 100644
index 0000000000..0a0f9ab017
--- /dev/null
+++ b/krita/integration/krita-preview/PreviewProvider.swift
@@ -0,0 +1,126 @@
+//
+// PreviewProvider.swift
+// krita-preview
+//
+// Created by Iván Yossi on 20/10/25.
+// Copyright © 2025 Stichting Krita Foundation. All rights reserved.
+//
+
+import Cocoa
+import Quartz
+
+class PreviewProvider: QLPreviewProvider, QLPreviewingController {
+
+
+ /*
+ Use a QLPreviewProvider to provide data-based previews.
+
+ To set up your extension as a data-based preview extension:
+
+ - Modify the extension's Info.plist by setting
+ <key>QLIsDataBasedPreview</key>
+ <true/>
+
+ - Add the supported content types to QLSupportedContentTypes array in the extension's Info.plist.
+
+ - Change the NSExtensionPrincipalClass to this class.
+ e.g.
+ <key>NSExtensionPrincipalClass</key>
+ <string>$(PRODUCT_MODULE_NAME).PreviewProvider</string>
+
+ - Implement providePreview(for:)
+ */
+
+ func providePreview(for request: QLFilePreviewRequest) async throws -> QLPreviewReply {
+
+ //You can create a QLPreviewReply in several ways, depending on the format of the data you want to return.
+ //To return Data of a supported content type:
+
+ var appImgData: Data
+
+ var appPlistRaw: Data? = UnzipTask(request.fileURL.path, "mergedimage.png")
+ if let appPlist = appPlistRaw {
+ appImgData = appPlist
+ } else {
+ appPlistRaw = UnzipTask(request.fileURL.path, "preview.png");
+ if let appPlist = appPlistRaw {
+ appImgData = appPlist
+ } else {
+ throw CocoaError.error(CocoaError.fileReadNoSuchFile)
+ }
+ }
+
+ let appIcon = NSImage.init(data: appImgData)
+ let rep = appIcon!.representations.first
+
+#if DEBUG
+ NSLog("krita-preview loaded file: \(request.fileURL.path)")
+ for representation in appIcon!.representations {
+ if let bitmapRep = representation as? NSBitmapImageRep {
+ NSLog("krita-preview bmp: \(bitmapRep.pixelsWide)x\(bitmapRep.pixelsHigh)")
+ // Access bitmap data, properties, etc.
+ } else {
+ NSLog("krita-preview: no representations")
+ }
+ }
+#endif
+
+ let contentType = UTType.png
+
+ let reply = QLPreviewReply.init(dataOfContentType: contentType, contentSize: CGSize.init(width: rep!.pixelsWide, height: rep!.pixelsHigh)) { (replyToUpdate : QLPreviewReply) in
+ return appImgData
+ }
+
+ return reply
+
+
+ /*
+ var appPlist = UnzipTask(request.fileURL.path, "mergedimage.png")
+ // Fallback to use preview is mergedimage is not present
+ if (appPlist == nil || appPlist!.isEmpty) {
+ appPlist = UnzipTask(request.fileURL.path, "preview.png");
+ }
+
+ if (appPlist != nil && !appPlist!.isEmpty) {
+ let appIcon = NSImage.init(data: appPlist!)
+ let rep = appIcon!.representations.first!
+
+#if DEBUG
+ NSLog("krita-preview loaded file: \(request.fileURL.path)")
+ for representation in appIcon!.representations {
+ if let bitmapRep = representation as? NSBitmapImageRep {
+ NSLog("krita-preview bmp: \(bitmapRep.pixelsWide)x\(bitmapRep.pixelsHigh)")
+ // Access bitmap data, properties, etc.
+ } else {
+ NSLog("krita-preview: no representations")
+ }
+ }
+#endif
+
+
+ let contentType = UTType.png
+
+ let reply = QLPreviewReply.init(dataOfContentType: contentType, contentSize: CGSize.init(width: rep.pixelsWide, height: rep.pixelsHigh)) { (replyToUpdate : QLPreviewReply) in
+ return appPlist!
+ }
+ return reply
+ }
+
+ // If nothing has been returned, return default code
+ // TODO: return krita generic image.
+
+ let contentType = UTType.plainText // replace with your data type
+ let reply = QLPreviewReply.init(dataOfContentType: contentType, contentSize: CGSize.init(width: 800, height: 800)) { (replyToUpdate : QLPreviewReply) in
+
+ let data = Data("Hello world".utf8)
+
+ //setting the stringEncoding for text and html data is optional and defaults to String.Encoding.utf8
+ replyToUpdate.stringEncoding = .utf8
+
+ //initialize your data here
+ return data
+ }
+ return reply
+ */
+ }
+}
diff --git a/krita/integration/krita-preview/PreviewViewController.swift b/krita/integration/krita-preview/PreviewViewController.swift
new file mode 100644
index 0000000000..06020f9ac2
--- /dev/null
+++ b/krita/integration/krita-preview/PreviewViewController.swift
@@ -0,0 +1,40 @@
+//
+// PreviewViewController.swift
+// krita-preview
+//
+// Created by Iván Yossi on 20/10/25.
+// Copyright © 2025 Stichting Krita Foundation. All rights reserved.
+//
+
+import Cocoa
+import Quartz
+
+class PreviewViewController: NSViewController, QLPreviewingController {
+
+ override var nibName: NSNib.Name? {
+ return NSNib.Name("PreviewViewController")
+ }
+
+ override func loadView() {
+ super.loadView()
+ // Do any additional setup after loading the view.
+ }
+
+ /*
+ func preparePreviewOfSearchableItem(identifier: String, queryString: String?) async throws {
+ // Implement this method and set QLSupportsSearchableItems to YES in the Info.plist of the extension if you support CoreSpotlight.
+
+ // Perform any setup necessary in order to prepare the view.
+ // Quick Look will display a loading spinner until this returns.
+ }
+ */
+
+ func preparePreviewOfFile(at url: URL) async throws {
+ // Add the supported content types to the QLSupportedContentTypes array in the Info.plist of the extension.
+
+ // Perform any setup necessary in order to prepare the view.
+
+ // Quick Look will display a loading spinner until this returns.
+ }
+
+}
diff --git a/krita/integration/krita-preview_helper/krita-preview-Info.plist b/krita/integration/krita-preview_helper/krita-preview-Info.plist
new file mode 100644
index 0000000000..c9590968fb
--- /dev/null
+++ b/krita/integration/krita-preview_helper/krita-preview-Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSExtension</key>
+ <dict>
+ <key>NSExtensionAttributes</key>
+ <dict>
+ <key>QLIsDataBasedPreview</key>
+ <true/>
+ <key>QLSupportedContentTypes</key>
+ <array>
+ <string>org.krita.kra</string>
+ </array>
+ <key>QLSupportsSearchableItems</key>
+ <false/>
+ </dict>
+ <key>NSExtensionPointIdentifier</key>
+ <string>com.apple.quicklook.preview</string>
+ <key>NSExtensionPrincipalClass</key>
+ <string>$(PRODUCT_MODULE_NAME).PreviewProvider</string>
+ </dict>
+</dict>
+</plist>
diff --git a/packaging/macos/osxdeploy.sh b/packaging/macos/osxdeploy.sh
index eadc1de5b3..3f1a740ed7 100755
--- a/packaging/macos/osxdeploy.sh
+++ b/packaging/macos/osxdeploy.sh
@@ -696,9 +696,12 @@ krita_deploy () {
rsync -prul ${KIS_INSTALL_DIR}/plugins/kritaspotlight.mdimporter ${KRITA_DMG}/krita.app/Contents/Library/Spotlight
# thumbnails for macOS 11.0 and up
- echo "Copying QuickLook Thumbnailing extension..."
+ echo "Copying Krita Thumbnailing extension..."
rsync -prul ${KIS_INSTALL_DIR}/plugins/krita-thumbnailer.appex ${KRITA_DMG_PLUGIN_DIR}
+ echo "Copying Krita Preview extension..."
+ rsync -prul ${KIS_INSTALL_DIR}/plugins/krita-preview.appex ${KRITA_DMG_PLUGIN_DIR}
+
cd ${BUILDROOT}
rsync -prul ${KIS_INSTALL_DIR}/lib/kritaplugins/* ${KRITA_DMG_PLUGIN_DIR}
@@ -805,6 +808,7 @@ signBundle() {
cd ${KRITA_DMG}/krita.app/Contents/PlugIns
printf "krita-thumbnailer.appex" | batch_codesign
+ printf "krita-preview.appex" | batch_codesign
# It is necessary to sign every binary Resource file
cd ${KRITA_DMG}/krita.app/Contents/Resources