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: working version of thumbnailer

Ivan Yossi921f9b73682d
diff --git a/krita/integration/integration.xcodeproj/project.pbxproj b/krita/integration/integration.xcodeproj/project.pbxproj
index 7405bc6576..5f0927362c 100644
--- a/krita/integration/integration.xcodeproj/project.pbxproj
+++ b/krita/integration/integration.xcodeproj/project.pbxproj
@@ -3,11 +3,12 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 54;
+ objectVersion = 70;
objects = {
/* Begin PBXBuildFile section */
114946422EA3FACB00515C4C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 114946412EA3FACB00515C4C /* AppKit.framework */; };
+ 114946572EA5624C00515C4C /* kritaquicklookng.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 84B7B62725619404003662DB /* kritaquicklookng.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 */; };
@@ -28,6 +29,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ 114946542EA561DD00515C4C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 84B7B62625619404003662DB;
+ remoteInfo = kritaquicklookng;
+ };
84B7B63525619534003662DB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84D650F0256036F000CC2E75 /* Project object */;
@@ -52,6 +60,17 @@
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
+ 114946562EA5622D00515C4C /* Embed App Extensions */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 13;
+ files = (
+ 114946572EA5624C00515C4C /* kritaquicklookng.appex in Embed App Extensions */,
+ );
+ name = "Embed App Extensions";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84D505B4256072AD005AFC55 /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -76,6 +95,7 @@
/* Begin PBXFileReference section */
114946412EA3FACB00515C4C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 114946472EA5593D00515C4C /* previewHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = previewHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
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 /* kritaquicklookng.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = kritaquicklookng.appex; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -103,7 +123,28 @@
84D6513A256043A000CC2E75 /* UnzipTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnzipTask.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
+/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
+ 114946532EA559CB00515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
+ isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
+ membershipExceptions = (
+ Info.plist,
+ );
+ target = 114946462EA5593D00515C4C /* previewHelper */;
+ };
+/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
+
+/* Begin PBXFileSystemSynchronizedRootGroup section */
+ 114946482EA5593D00515C4C /* previewHelper */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (114946532EA559CB00515C4C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = previewHelper; sourceTree = "<group>"; };
+/* End PBXFileSystemSynchronizedRootGroup section */
+
/* Begin PBXFrameworksBuildPhase section */
+ 114946442EA5593D00515C4C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62425619404003662DB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -181,6 +222,7 @@
84D651082560370B00CC2E75 /* quicklook */,
84D651182560371600CC2E75 /* spotlight */,
84B7B62C25619404003662DB /* quicklookng */,
+ 114946482EA5593D00515C4C /* previewHelper */,
84D650F9256036F000CC2E75 /* Products */,
84A059902560A72500E4EAFD /* Frameworks */,
);
@@ -193,6 +235,7 @@
84D651172560371600CC2E75 /* kritaspotlight.mdimporter */,
84D505D725608693005AFC55 /* libunziptask.a */,
84B7B62725619404003662DB /* kritaquicklookng.appex */,
+ 114946472EA5593D00515C4C /* previewHelper.app */,
);
name = Products;
sourceTree = "<group>";
@@ -275,6 +318,30 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
+ 114946462EA5593D00515C4C /* previewHelper */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1149464F2EA5594000515C4C /* Build configuration list for PBXNativeTarget "previewHelper" */;
+ buildPhases = (
+ 114946432EA5593D00515C4C /* Sources */,
+ 114946442EA5593D00515C4C /* Frameworks */,
+ 114946452EA5593D00515C4C /* Resources */,
+ 114946562EA5622D00515C4C /* Embed App Extensions */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 114946552EA561DD00515C4C /* PBXTargetDependency */,
+ );
+ fileSystemSynchronizedGroups = (
+ 114946482EA5593D00515C4C /* previewHelper */,
+ );
+ name = previewHelper;
+ packageProductDependencies = (
+ );
+ productName = previewHelper;
+ productReference = 114946472EA5593D00515C4C /* previewHelper.app */;
+ productType = "com.apple.product-type.application";
+ };
84B7B62625619404003662DB /* kritaquicklookng */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84B7B63325619404003662DB /* Build configuration list for PBXNativeTarget "kritaquicklookng" */;
@@ -357,10 +424,13 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
- LastSwiftUpdateCheck = 1130;
+ LastSwiftUpdateCheck = 2600;
LastUpgradeCheck = 2600;
ORGANIZATIONNAME = "Stichting Krita Foundation";
TargetAttributes = {
+ 114946462EA5593D00515C4C = {
+ CreatedOnToolsVersion = 26.0.1;
+ };
84B7B62625619404003662DB = {
CreatedOnToolsVersion = 11.3.1;
LastSwiftMigration = 1130;
@@ -393,11 +463,19 @@
84D651162560371600CC2E75 /* kritaspotlight */,
84D505D625608693005AFC55 /* unziptask */,
84B7B62625619404003662DB /* kritaquicklookng */,
+ 114946462EA5593D00515C4C /* previewHelper */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 114946452EA5593D00515C4C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62525619404003662DB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -422,6 +500,13 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 114946432EA5593D00515C4C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
84B7B62325619404003662DB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -462,6 +547,11 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
+ 114946552EA561DD00515C4C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 84B7B62625619404003662DB /* kritaquicklookng */;
+ targetProxy = 114946542EA561DD00515C4C /* PBXContainerItemProxy */;
+ };
84B7B63625619534003662DB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84D505D625608693005AFC55 /* unziptask */;
@@ -480,6 +570,80 @@
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
+ 114946502EA5594000515C4C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_PREVIEWS = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = previewHelper/Info.plist;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = org.krita.previewHelper;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ REGISTER_APP_GROUPS = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 114946512EA5594000515C4C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_APP_SANDBOX = YES;
+ ENABLE_PREVIEWS = YES;
+ ENABLE_USER_SELECTED_FILES = readonly;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = previewHelper/Info.plist;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Stichting Krita Foundation. All rights reserved.";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = org.krita.previewHelper;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ REGISTER_APP_GROUPS = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
84B7B63125619404003662DB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -487,7 +651,7 @@
CODE_SIGN_ENTITLEMENTS = quicklookng/quicklookng.entitlements;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
- ENABLE_APP_SANDBOX = NO;
+ ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -500,8 +664,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
- MARKETING_VERSION = 5.0;
- PRODUCT_BUNDLE_IDENTIFIER = org.krita.quicklookng;
+ PRODUCT_BUNDLE_IDENTIFIER = org.krita.previewHelper.quicklookng;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -517,7 +680,7 @@
CODE_SIGN_ENTITLEMENTS = quicklookng/quicklookng.entitlements;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
- ENABLE_APP_SANDBOX = NO;
+ ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = quicklookng/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -525,8 +688,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
- MARKETING_VERSION = 5.0;
- PRODUCT_BUNDLE_IDENTIFIER = org.krita.quicklookng;
+ PRODUCT_BUNDLE_IDENTIFIER = org.krita.previewHelper.quicklookng;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "quicklookng/quicklookng-Bridging-Header.h";
@@ -592,11 +754,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 5.2.13;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -614,11 +776,13 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../../../../../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
+ MARKETING_VERSION = 5.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
@@ -656,11 +820,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 5.2.13;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = NOUNCRYPT;
@@ -672,6 +836,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../../../../../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
+ MARKETING_VERSION = 5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
@@ -743,6 +908,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 1149464F2EA5594000515C4C /* Build configuration list for PBXNativeTarget "previewHelper" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 114946502EA5594000515C4C /* Debug */,
+ 114946512EA5594000515C4C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
84B7B63325619404003662DB /* Build configuration list for PBXNativeTarget "kritaquicklookng" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/kritaquicklookng.xcscheme b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/kritaquicklookng.xcscheme
new file mode 100644
index 0000000000..2a318f5f48
--- /dev/null
+++ b/krita/integration/integration.xcodeproj/xcshareddata/xcschemes/kritaquicklookng.xcscheme
@@ -0,0 +1,79 @@
+<?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 = "84B7B62625619404003662DB"
+ BuildableName = "kritaquicklookng.appex"
+ BlueprintName = "kritaquicklookng"
+ 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"
+ askForAppToLaunch = "Yes"
+ launchAutomaticallySubstyle = "2">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "84B7B62625619404003662DB"
+ BuildableName = "kritaquicklookng.appex"
+ BlueprintName = "kritaquicklookng"
+ ReferencedContainer = "container:integration.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/krita/integration/previewHelper/Assets.xcassets/AccentColor.colorset/Contents.json b/krita/integration/previewHelper/Assets.xcassets/AccentColor.colorset/Contents.json
new file mode 100644
index 0000000000..eb87897008
--- /dev/null
+++ b/krita/integration/previewHelper/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -0,0 +1,11 @@
+{
+ "colors" : [
+ {
+ "idiom" : "universal"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/krita/integration/previewHelper/Assets.xcassets/AppIcon.appiconset/Contents.json b/krita/integration/previewHelper/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000000..3f00db43ec
--- /dev/null
+++ b/krita/integration/previewHelper/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,58 @@
+{
+ "images" : [
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "16x16"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "16x16"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "32x32"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "32x32"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "128x128"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "128x128"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "256x256"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "256x256"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "512x512"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "512x512"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/krita/integration/previewHelper/Assets.xcassets/Contents.json b/krita/integration/previewHelper/Assets.xcassets/Contents.json
new file mode 100644
index 0000000000..73c00596a7
--- /dev/null
+++ b/krita/integration/previewHelper/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/krita/integration/previewHelper/ContentView.swift b/krita/integration/previewHelper/ContentView.swift
new file mode 100644
index 0000000000..987d7b21f2
--- /dev/null
+++ b/krita/integration/previewHelper/ContentView.swift
@@ -0,0 +1,24 @@
+//
+// ContentView.swift
+// previewHelper
+//
+// Created by Iván Yossi on 19/10/25.
+// Copyright © 2025 Stichting Krita Foundation. All rights reserved.
+//
+
+import SwiftUI
+
+struct ContentView: View {
+ var body: some View {
+ VStack {
+ Image(systemName: "globe")
+ .imageScale(.large)
+ Text("Hello, world!")
+ }
+ .padding()
+ }
+}
+
+#Preview {
+ ContentView()
+}
diff --git a/krita/integration/previewHelper/Info.plist b/krita/integration/previewHelper/Info.plist
new file mode 100644
index 0000000000..087bc4c8d5
--- /dev/null
+++ b/krita/integration/previewHelper/Info.plist
@@ -0,0 +1,125 @@
+<?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>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Krita File</string>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>LSHandlerRank</key>
+ <string>Alternate</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>org.krita.kra</string>
+ </array>
+ <key>NSDocumentClass</key>
+ <string></string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Krita File</string>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>LSHandlerRank</key>
+ <string>Alternate</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>org.krita.krz</string>
+ </array>
+ <key>NSDocumentClass</key>
+ <string></string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Openraster File</string>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>LSHandlerRank</key>
+ <string>Alternate</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>org.openraster.ora</string>
+ </array>
+ </dict>
+ </array>
+ <key>UTImportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ <string>public.image</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Krita File</string>
+ <key>UTTypeIcons</key>
+ <dict/>
+ <key>UTTypeIdentifier</key>
+ <string>org.krita.kra</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>kra</string>
+ </array>
+ <key>public.mime-type</key>
+ <array>
+ <string>application/x-krita-kra</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ <string>public.archive</string>
+ <string>public.image</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Krita File</string>
+ <key>UTTypeIcons</key>
+ <dict/>
+ <key>UTTypeIdentifier</key>
+ <string>org.krita.krz</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>krz</string>
+ </array>
+ <key>public.mime-type</key>
+ <array>
+ <string>application/x-krita-krz</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ <string>public.image</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Openraster File</string>
+ <key>UTTypeIcons</key>
+ <dict/>
+ <key>UTTypeIdentifier</key>
+ <string>org.openraster.ora</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>ora</string>
+ </array>
+ <key>public.mime-type</key>
+ <array>
+ <string>image/openraster</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
+</dict>
+</plist>
diff --git a/krita/integration/previewHelper/previewHelperApp.swift b/krita/integration/previewHelper/previewHelperApp.swift
new file mode 100644
index 0000000000..b997d5e457
--- /dev/null
+++ b/krita/integration/previewHelper/previewHelperApp.swift
@@ -0,0 +1,18 @@
+//
+// previewHelperApp.swift
+// previewHelper
+//
+// Created by Iván Yossi on 19/10/25.
+// Copyright © 2025 Stichting Krita Foundation. All rights reserved.
+//
+
+import SwiftUI
+
+@main
+struct previewHelperApp: App {
+ var body: some Scene {
+ WindowGroup {
+ ContentView()
+ }
+ }
+}
diff --git a/krita/integration/quicklookng/Info.plist b/krita/integration/quicklookng/Info.plist
index 80e91f0774..70f265b4ae 100644
--- a/krita/integration/quicklookng/Info.plist
+++ b/krita/integration/quicklookng/Info.plist
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
- <string>5.2.14</string>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
diff --git a/krita/integration/quicklookng/ThumbnailProvider.swift b/krita/integration/quicklookng/ThumbnailProvider.swift
index 05d32b09ba..23e49a707d 100644
--- a/krita/integration/quicklookng/ThumbnailProvider.swift
+++ b/krita/integration/quicklookng/ThumbnailProvider.swift
@@ -22,6 +22,7 @@
import AppKit
import QuickLookThumbnailing
+
class ThumbnailProvider: QLThumbnailProvider {
// override init() {
@@ -29,7 +30,9 @@ class ThumbnailProvider: QLThumbnailProvider {
// super.init()
// }
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) {
- print("handler called org.krita.kra")
+ #if DEBUG
+ NSLog("handler called org.krita.kra")
+ #endif
// There are three ways to provide a thumbnail through a QLThumbnailReply. Only one of them should be used.
// First way: Draw the thumbnail into the current context, set up with UIKit's coordinate system.
@@ -39,44 +42,69 @@ class ThumbnailProvider: QLThumbnailProvider {
// Return true if the thumbnail was successfully drawn inside this block.
return true
}), nil) */
-
+
// Second way: Draw the thumbnail into a context passed to your block, set up with Core Graphics's coordinate system.
-// handler(QLThumbnailReply(contextSize: request.maximumSize, drawing: { (context: CGContext) -> Bool in
- handler(QLThumbnailReply(contextSize: request.maximumSize, currentContextDrawing: { () -> Bool in
- // Draw the thumbnail here.
-
- var appPlist = UnzipTask(request.fileURL.path, "preview.png")
+
+ var appPlist = UnzipTask(request.fileURL.path, "preview.png")
- // Not made with Krita. Find ORA thumbnail instead.
- if (appPlist == nil || appPlist!.isEmpty) {
- appPlist = UnzipTask(request.fileURL.path, "Thumbnails/thumbnail.png");
- }
-
- if (appPlist != nil && !appPlist!.isEmpty) {
- let appIcon = NSImage.init(data: appPlist!)
+ // Not made with Krita. Find ORA thumbnail instead.
+ if (appPlist == nil || appPlist!.isEmpty) {
+ appPlist = UnzipTask(request.fileURL.path, "Thumbnails/thumbnail.png");
+ }
-// let rep = appIcon!.representations.first!
+ if (appPlist != nil && !appPlist!.isEmpty) {
+ let appIcon = NSImage.init(data: appPlist!)
+
+ let rep = appIcon!.representations.first!
- let renderRect = NSMakeRect(0.0, 0.0, request.maximumSize.width, request.maximumSize.height)
+#if DEBUG
+ NSLog("kritaquicklookngs file: \(request.fileURL.path)")
+ for representation in appIcon!.representations {
+ if let bitmapRep = representation as? NSBitmapImageRep {
+ NSLog("kritaquicklookngs bmp: \(bitmapRep.pixelsWide)x\(bitmapRep.pixelsHigh)")
+ // Access bitmap data, properties, etc.
+ } else {
+ NSLog("kritaquicklookngs: no rep")
+ }
+ }
+#endif
- appIcon?.draw(in: renderRect)
-
-// guard let cgImage = appIcon?.cgImage(forProposedRect: &renderRect, context: nil, hints: nil)
-// else {
-// return false
-// }
-//
-// context.draw(cgImage, in: renderRect);
+ // asume request rect is a rectangle
+ var dstwidth: Float
+ var dstheight: Float
+ let ratio: Float = Float(rep.pixelsHigh) / Float(rep.pixelsWide)
+ if ratio > 1.0 {
+ dstwidth = Float(request.maximumSize.height) * (1 / ratio)
+ dstheight = Float(request.maximumSize.height)
} else {
- return false
+ dstwidth = Float(request.maximumSize.width)
+ dstheight = Float(request.maximumSize.width) * ratio
}
-
- // Return true if the thumbnail was successfully drawn inside this block.
- return true
- }), nil)
-
+ var renderRect = NSMakeRect(0.0, 0.0,
+ CGFloat(dstwidth),
+ CGFloat(dstheight)
+ )
+#if DEBUG
+ NSLog("kritaquicklookngs: \(renderRect.size) \(request.maximumSize) \(dstwidth)x\(dstheight) - \(request.maximumSize.width) x \(request.maximumSize.height)")
+ NSLog("kritaquicklookngs_calc: ratio: \(ratio) scale \(request.scale)")
+#endif
+
+ handler(QLThumbnailReply(contextSize: renderRect.size, drawing: { (context: CGContext) -> Bool in
+ // handler(QLThumbnailReply(contextSize: request.maximumSize, currentContextDrawing: { () -> Bool in
+ // Draw the thumbnail here.
+ // appIcon?.draw(in: renderRect)
+
+ let cgImage = appIcon?.cgImage(forProposedRect: &renderRect, context: nil, hints: nil);
+ renderRect.size.width *= request.scale
+ renderRect.size.height *= request.scale
+ context.draw(cgImage!, in: renderRect);
+
+ // Return true if the thumbnail was successfully drawn inside this block.
+ return true
+ }), nil)
+ }
// Third way: Set an image file URL.
/* handler(QLThumbnailReply(imageFileURL: Bundle.main.url(forResource: "fileThumbnail", withExtension: "jpg")!), nil) */
}