From a391018d51cca9ccd85836936da9345666d9b06e9598a3afff3c937e280cb246 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Mon, 23 Sep 2024 08:49:18 +0000 Subject: [PATCH] Update to 3.4.2 OBS-URL: https://build.opensuse.org/package/show/graphics/gmic?expand=0&rev=99 --- .gitattributes | 23 + .gitignore | 1 + 0001-Find-the-local-gmic-library.patch | 57 + _constraints | 17 + gmic.changes | 1106 ++++++++++++++++++ gmic.spec | 278 +++++ gmic_3.4.0.tar.gz | 3 + gmic_3.4.2.tar.gz | 3 + krita5.patch | 1442 ++++++++++++++++++++++++ 9 files changed, 2930 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Find-the-local-gmic-library.patch create mode 100644 _constraints create mode 100644 gmic.changes create mode 100644 gmic.spec create mode 100644 gmic_3.4.0.tar.gz create mode 100644 gmic_3.4.2.tar.gz create mode 100644 krita5.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Find-the-local-gmic-library.patch b/0001-Find-the-local-gmic-library.patch new file mode 100644 index 0000000..e39fe33 --- /dev/null +++ b/0001-Find-the-local-gmic-library.patch @@ -0,0 +1,57 @@ +From 7c185a08bd2f37c1831542651db3b048ba231ae6 Mon Sep 17 00:00:00 2001 +From: Christophe Marin +Date: Mon, 17 Apr 2023 16:07:00 +0200 +Subject: [PATCH] Find the local gmic library + +GMic's working build system was replaced by a Makefile for unknown reasons + +To keep using CMake in gmic-qt, we need to find the locally built gmic library. +--- + gmic-qt/CMakeLists.txt | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt +index 0641f4c..17d1535 100644 +--- a/gmic-qt/CMakeLists.txt ++++ b/gmic-qt/CMakeLists.txt +@@ -149,7 +149,13 @@ endif() + # Gmic + # + if (ENABLE_SYSTEM_GMIC) +- find_package(Gmic REQUIRED CONFIG) ++ find_library(GMIC_LIBRARY gmic PATHS ${CMAKE_SOURCE_DIR}/../src) ++ find_path(GMIC_INCLUDE_DIR gmic.h PATHS ${CMAKE_SOURCE_DIR}/../src) ++ add_library(GMic::GMic UNKNOWN IMPORTED) ++ set_target_properties(GMic::GMic PROPERTIES ++ IMPORTED_LOCATION "${GMIC_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${GMIC_INCLUDE_DIR}" ++ ) + endif (ENABLE_SYSTEM_GMIC) + + # +@@ -610,10 +616,10 @@ if(ENABLE_DYNAMIC_LINKING) + ${gmic_qt_LIBRARIES} + libgmicstatic + ) +- elseif(TARGET libgmic) ++ elseif(TARGET GMic::GMic) + set(gmic_qt_LIBRARIES + ${gmic_qt_LIBRARIES} +- libgmic ++ GMic::GMic + ) + elseif(GMIC_LIB_PATH) + set(gmic_qt_LIBRARIES +@@ -645,9 +651,6 @@ if(ENABLE_DYNAMIC_LINKING) + ${CURL_LIBRARIES} + ${EXTRA_LIBRARIES}) + endif() +- else() +- # Inject the G'MIC CImg plugin. +- include_directories(../src) + endif() + else(ENABLE_DYNAMIC_LINKING) + set(gmic_qt_SRCS +-- +2.45.2 + diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..bc20e6b --- /dev/null +++ b/_constraints @@ -0,0 +1,17 @@ + + + + 4 + + + + + ppc64le + + + + 5 + + + + diff --git a/gmic.changes b/gmic.changes new file mode 100644 index 0000000..7a8cd52 --- /dev/null +++ b/gmic.changes @@ -0,0 +1,1106 @@ +------------------------------------------------------------------- +Mon Sep 23 08:39:16 UTC 2024 - Christophe Marin + +- Update to 3.4.2. No changelog. + +------------------------------------------------------------------- +Fri Jun 28 07:42:52 UTC 2024 - Christophe Marin + +- Update to 3.4.0 + https://discuss.pixls.us/t/release-of-gmic-3-4/39353 + * New filters added: color wheel, blur (motion), underwoods, + spline spirograph, distort (RBF), color mixer +- Update build constraints + +------------------------------------------------------------------- +Thu Apr 11 12:00:55 UTC 2024 - Christophe Marin + +- Update to 3.3.5. No changelog. + +------------------------------------------------------------------- +Thu Feb 1 10:57:00 UTC 2024 - Christophe Marin + +- Update to 3.3.3. No changelog. +- Rebase krita5.patch + +------------------------------------------------------------------- +Thu Dec 28 15:59:44 UTC 2023 - Christophe Marin + +- Update to 3.3.2. No changelog. +- Rebase krita5.patch + +------------------------------------------------------------------- +Thu Dec 28 15:58:05 UTC 2023 - Christophe Marin + +- Require extra-cmake-modules at build time + +------------------------------------------------------------------- +Fri Oct 6 14:42:34 UTC 2023 - Christophe Marin + +- Update to 3.3.1. No changelog. + +------------------------------------------------------------------- +Mon Sep 4 13:05:59 UTC 2023 - Christophe Marin + +- Update to 3.3.0. + Check https://discuss.pixls.us/t/release-of-gmic-3-3/34786 for + the full list of changes + * Interactive image viewer using display has been improved a lot + * Command is_3d renamed as is_mesh3d + * New command strbuffer returns a string describing a buffer size + * New command rand_sum fills selected images with strictly + positive, random, integer values, that sums to specified + fixed value + * Starting a fill expression with + forces it to be evaluated + in a single thread, but with an image copy (equivalent to + * without multi-threading) + * Allow run() to be run in parallel in math parser + +------------------------------------------------------------------- +Tue Jun 27 07:39:47 UTC 2023 - Paolo Stivanin + +- Update to 3.2.6. No changelog. + +------------------------------------------------------------------- +Wed May 31 11:03:50 UTC 2023 - Christophe Marin + +- Update to 3.2.5. No changelog. + +------------------------------------------------------------------- +Wed Apr 26 18:59:15 UTC 2023 - Jan Engelhardt + +- Replace BuildRequire on xorg-x11-devel by pkgconfig(...) + +------------------------------------------------------------------- +Mon Apr 17 09:31:24 UTC 2023 - Christophe Marin + +- Update to 3.2.3. No changelog +- Drop patches, merged upstream: + * 0001-Fix-Qt-form-paths-in-CMakeLists.patch + * 0001-Do-not-build-all-host-code-by-default.patch +- Rework 0001-Find-the-local-gmic-library.patch to speed up build + and fix failures on Leap + +------------------------------------------------------------------- +Mon Mar 20 13:14:26 UTC 2023 - Christophe Marin + +- Update to 3.2.2. No changelog. +- Rebase krita5.patch +- Add upstream gmic-qt changes: + * 0001-Fix-Qt-form-paths-in-CMakeLists.patch + * 0001-Do-not-build-all-host-code-by-default.patch + +------------------------------------------------------------------- +Sun Feb 19 16:52:48 UTC 2023 - Marcus Rueckert + +- Update to 3.2.1. No changelog. + +------------------------------------------------------------------- +Mon Jan 16 10:05:02 UTC 2023 - Christophe Marin + +- Update to 3.2.0 + * https://discuss.pixls.us/t/release-of-gmic-3-2/30567#uwhats-new-in-version-32u-2 + * Fix saving output file in .png format with stand-alone version. + * Fix command texturize3d (a.k.a. t3d) when used on large + 3D object + * Saving animated .gif now better handles alpha-channels + * Fix behavior of using break in a foreach...done loop +- Rebase krita5.patch + +------------------------------------------------------------------- +Mon Dec 19 15:49:41 UTC 2022 - pgajdos@suse.com + +- GraphicsMagick is not required for build [bsc#1206620] + +------------------------------------------------------------------- +Mon Sep 26 07:35:42 UTC 2022 - Christophe Giboudeaux + +- Use opencv 4 for building gmic on 15.4 and PowerPC + +------------------------------------------------------------------- +Fri Sep 2 07:08:01 UTC 2022 - Christophe Giboudeaux + +- Update to 3.1.6 + * HiDPI support added to gmic-qt +- Rebase krita5.patch + +------------------------------------------------------------------- +Thu Aug 25 07:44:24 UTC 2022 - Christophe Giboudeaux + +- Update to 3.1.5. No changelog. +- Drop patch, merged upstream: + * gmic-qt-make-it-work-without-gmic-cpp.patch + +------------------------------------------------------------------- +Wed Jun 29 09:03:35 UTC 2022 - Christophe Giboudeaux + +- Update to 3.1.4. No changelog. +- Rebase krita5.patch + +------------------------------------------------------------------- +Wed May 11 14:24:36 UTC 2022 - Paolo Stivanin + +- Update to 3.1.2. No changelog. + +------------------------------------------------------------------- +Fri Apr 29 06:37:52 UTC 2022 - Christophe Giboudeaux + +- Update to 3.1.0. No changelog. +- Rebase patches: + * krita5.patch +- Add patch to keep using CMake when building gmic-qt: + * 0001-Find-the-local-gmic-library.patch +- Drop patch, no longer needed: + * 0001-Remove-unneeded-CImg-include.patch + +------------------------------------------------------------------- +Mon Feb 7 10:11:38 UTC 2022 - Christophe Giboudeaux + +- Update to 3.0.2. No changelog. +- Drop upstream changes: + * gmic-make-build-without-gmic-cpp.patch + * 56f7340ecb1fbbe6fce87d0a5c8d35dd13359577.patch +- Rebase patches: + * gmic-qt-make-it-work-without-gmic-cpp.patch + * krita5.patch +- Add patch: + * 0001-Remove-unneeded-CImg-include.patch + +------------------------------------------------------------------- +Tue Jan 18 10:11:09 UTC 2022 - Christophe Giboudeaux + +- Spec cleanup. + +------------------------------------------------------------------- +Sun Jan 16 21:16:02 UTC 2022 - Marcus Rueckert + +- added https://github.com/dtschump/gmic/commit/56f7340ecb1fbbe6fce87d0a5c8d35dd13359577.patch + make it search in /usr/share/gmic/ with all clients. + +------------------------------------------------------------------- +Sat Jan 15 18:48:24 UTC 2022 - Marcus Rueckert + +- prepare gimp 3 support +- install also the denoise data file +- introduce a new gmic-data subpackage and require it from all the + frontends so we can access it more easily once this is resolved: + https://discuss.pixls.us/t/fixing-more-things-in-gmic-packaging/28894 +- make bash-completion noarch + +------------------------------------------------------------------- +Fri Jan 14 18:44:35 UTC 2022 - Marcus Rueckert + +- move shared options for all the gmic-qt versions into a define + to reduce duplication + +------------------------------------------------------------------- +Fri Jan 14 18:41:47 UTC 2022 - Marcus Rueckert + +- Rework patches: + - drop old patches with git generated copies: + - 5e34754707b78358ef818d542d1e81d008bb2d12.patch + - dont-set-gmic_build.patch + - gmic-krita5.patch + - make-build-without-gmic-cpp.patch + - new patches: + - gmic-make-build-without-gmic-cpp.patch + - gmic-qt-make-it-work-without-gmic-cpp.patch + - krita5.patch +- Update krita patch so we can apply it as normal patch without + breaking other gmic-qt instances + +------------------------------------------------------------------- +Fri Jan 14 17:39:09 UTC 2022 - Marcus Rueckert + +- Remove unneeded BuildRequires fftw3-devel and cmake(KF5CoreAddons) + +------------------------------------------------------------------- +Fri Jan 14 17:31:52 UTC 2022 - Marcus Rueckert + +- Use simpler syntax for the pkg version comparison + +------------------------------------------------------------------- +Fri Jan 14 16:36:21 UTC 2022 - Marcus Rueckert + +- enable building with Krita 5 + new BR: krita-devel + new patches: + - 5e34754707b78358ef818d542d1e81d008bb2d12.patch + - gmic-krita5.patch + +------------------------------------------------------------------- +Fri Jan 14 11:01:21 UTC 2022 - Marcus Rueckert + +- Add dont-set-gmic_build.patch: + Make gmic-qt flavors build without gmic.cpp. This should help + with getting the new krita plugin built + +------------------------------------------------------------------- +Thu Jan 13 22:27:47 UTC 2022 - Marcus Rueckert + +- enable opencv support xshm support + - Add BuildRequires xorg-x11-devel + +------------------------------------------------------------------- +Thu Jan 13 22:26:56 UTC 2022 - Marcus Rueckert + +- add missing files for to make the devel package work: + make-build-without-gmic-cpp.patch +- also track series for easier patching + +------------------------------------------------------------------- +Thu Jan 13 21:41:27 UTC 2022 - Marcus Rueckert + +- Add Conflicts for krita >= 5 as it needs the intree version of + gmic-qt now + +------------------------------------------------------------------- +Thu Jan 13 21:25:00 UTC 2022 - Marcus Rueckert + +- Update to 3.0.1 + https://discuss.pixls.us/t/on-the-road-to-3-1/28221 + +------------------------------------------------------------------- +Mon Dec 13 09:47:22 UTC 2021 - Christophe Giboudeaux + +- Update to 3.0.0. No changelog. +- Drop 0001-cmake-Set-target-compile-flags-correctly.patch. + Merged upstream. + +------------------------------------------------------------------- +Sun Nov 7 13:48:14 UTC 2021 - Andreas Schneider + +- Enable Link Time Optimizations (LTO) +- Fix building with optflags + * Added 0001-cmake-Set-target-compile-flags-correctly.patch + +------------------------------------------------------------------- +Sat Sep 11 14:54:42 UTC 2021 - Christophe Giboudeaux + +- Update to 2.9.9. No changelog. + +------------------------------------------------------------------- +Mon Jul 19 08:23:07 UTC 2021 - Christophe Giboudeaux + +- Update to 2.9.8. No changelog. + +------------------------------------------------------------------- +Mon Apr 12 09:49:02 UTC 2021 - Christophe Giboudeaux + +- Update to 2.9.7. No changelog. + +------------------------------------------------------------------- +Wed Feb 10 17:06:54 UTC 2021 - Christophe Giboudeaux + +- Update to 2.9.6. No changelog. +- Drop the digikam-plugin-gmic subpackage. Integration was + removed upstream. +- Drop 0001-Don-t-use-CMake-commands-not-available-in-CMake-3.9.patch + no longer needed. + +------------------------------------------------------------------- +Thu Nov 26 15:17:29 UTC 2020 - Christophe Giboudeaux + +- Update to 2.9.4. No changelog. + +------------------------------------------------------------------- +Mon Nov 23 16:22:35 UTC 2020 - Christophe Giboudeaux + +- Update to 2.9.3. No changelog. + +------------------------------------------------------------------- +Tue Sep 8 10:33:50 UTC 2020 - Christophe Giboudeaux + +- Update to 2.9.2. No changelog. +- Update 0001-Don-t-use-CMake-commands-not-available-in-CMake-3.9.patch + +------------------------------------------------------------------- +Sun Jun 14 09:25:43 UTC 2020 - Christophe Giboudeaux + +- Update to 2.9.1. No changelog. +- Add patch to allow building gmic with older CMake versions: + * 0001-Don-t-use-CMake-commands-not-available-in-CMake-3.9.patch +- Move the bash completion file to its own package + +------------------------------------------------------------------- +Sat Mar 28 19:04:56 UTC 2020 - Christophe Giboudeaux + +- Update to 2.9.0. No changelog. + +------------------------------------------------------------------- +Mon Feb 10 23:56:42 UTC 2020 - Christophe Giboudeaux + +- Update to 2.8.4. No changelog. + +------------------------------------------------------------------- +Fri Jan 24 08:19:13 UTC 2020 - Paolo Stivanin + +- update to 2.8.3. No changelog + +------------------------------------------------------------------- +Tue Jan 14 20:44:14 UTC 2020 - Christophe Giboudeaux + +- Update to 2.8.2. No changelog. + +------------------------------------------------------------------- +Tue Jan 14 17:54:46 UTC 2020 - Andreas Schneider + +- Disable LTO as it removes required symbols + * https://discuss.pixls.us/t/gmic-lookup-symbol-err-on-opensuse-darktable-master-build/15827 + +------------------------------------------------------------------- +Wed Dec 25 08:22:52 UTC 2019 - Christophe Giboudeaux + +- Update to 2.8.1. No changelog. + +------------------------------------------------------------------- +Thu Dec 5 10:31:47 UTC 2019 - Christophe Giboudeaux + +- Update to 2.8.0. No changelog available. + +------------------------------------------------------------------- +Wed Oct 30 08:25:40 UTC 2019 - Christophe Giboudeaux + +- Update to 2.7.5. No changelog. + +------------------------------------------------------------------- +Fri Oct 11 20:16:45 UTC 2019 - Christophe Giboudeaux + +- Update to 2.7.4. No changelog available + +------------------------------------------------------------------- +Mon Sep 23 11:41:08 UTC 2019 - Christophe Giboudeaux + +- Update to 2.7.2. No changelog available +- Enable the digikam plugin + +------------------------------------------------------------------- +Sun Sep 8 19:29:39 UTC 2019 - Christophe Giboudeaux + +- Update to 2.7.1, no changelog available +- Use cmake() and pkgconfig() for build requirements when possible +- Run spec-cleaner +- Prepare the spec file for the future gmic-digikam plugin +- Drop cmake-fixes.patch, no longer needed +- Drop gmic_reference.pdf +- Use %cmake_build, remove the ninja dependency +- Trim the package description + +------------------------------------------------------------------- +Wed May 22 16:05:55 UTC 2019 - Marcus Rueckert + +- update to 2.6.3 + https://discuss.pixls.us/t/release-of-gmic-2-6/12240 + +------------------------------------------------------------------- +Fri Mar 22 12:48:29 UTC 2019 - Marcus Rueckert + +- update to 2.5.4 + optimizations of the FFT transform, as well as the convolution + with small kernel (up to 5x5 and 3x3x3). + +------------------------------------------------------------------- +Mon Mar 18 16:41:50 UTC 2019 - Marcus Rueckert + +- move desktop file category to Qt + +------------------------------------------------------------------- +Mon Mar 18 12:59:39 UTC 2019 - Marcus Rueckert + +- update to 2.5.3 + * no changelog from upstream +- add desktop file + +------------------------------------------------------------------- +Fri Mar 15 23:51:08 UTC 2019 - Marcus Rueckert + +- update to 2.5.2: + fix for filters broken by using eigen3 +- update gmic_reference.pdf + +------------------------------------------------------------------- +Thu Mar 14 17:17:41 UTC 2019 - Marcus Rueckert + +- update to 2.5.1 + https://discuss.pixls.us/t/release-of-gmic-2-5/9413 +- refresh cmake-fixes.patch: + only lowering of cmake version remains, all other changes are + upstream + +------------------------------------------------------------------- +Wed Nov 7 12:30:34 UTC 2018 - Marcus Rueckert + +- added cmake-fixes.patch: + - allow older cmake versions again to allow building on distros + older than TW + - install cmake modules into the proper path + +------------------------------------------------------------------- +Wed Nov 7 00:33:15 UTC 2018 - Marcus Rueckert + +- update to 2.4.1 + https://discuss.pixls.us/t/release-of-gmic-2-4-0/8093 + https://discuss.pixls.us/t/on-the-road-to-2-5-0/9413 + +------------------------------------------------------------------- +Thu Aug 30 08:28:35 UTC 2018 - Andreas Schneider + +- Update to gmic-2.3.6 + * New/improved filters (poissondisk, colorful blobs, pointcloud, ...). + * Better interactivity with points on preview window. + * A bunch of other bugfixes and small improvements. +- Removed gmic-2.3.0-add-cmake-for-qt.patch + +------------------------------------------------------------------- +Fri Aug 24 09:27:55 UTC 2018 - asn@cryptomilk.org + +- Update to gmic-2.3.5 + +------------------------------------------------------------------- +Thu Jul 5 17:09:54 UTC 2018 - mrueckert@suse.de + +- Update to gmic-2.3.3 + - fixes small bugs discovered these last days (+ provides updated + filters). +- drop patches included in update + - gmic-2.3.0-zart-qbuttongroup.patch +- updated the gmic-2.3.0-add-cmake-for-qt.patch to remove the + chunks missing when upstream applied the patch + +------------------------------------------------------------------- +Thu Jun 21 12:47:34 UTC 2018 - asn@cryptomilk.org + +- Update to gmic-2.3.0 + * https://discuss.pixls.us/t/release-of-gmic-2-3-0/ +- Remove gmic-qt-2.2.2-Use-HiDPI-icons.patch +- Added gmic-2.3.0-add-cmake-for-qt.patch + +------------------------------------------------------------------- +Thu May 3 17:33:29 UTC 2018 - asn@cryptomilk.org + +- Update to gmic-2.2.2 + * https://discuss.pixls.us/t/release-of-gmic-2-2-0/ +- Add patch gmic-qt-2.2.2-Use-HiDPI-icons.patch +- Remove patch gmic-cflags.diff +- Remove patch gmic-docdir.diff +- Remove patch gmic-make-zart.diff +- Remove patch gmic-oldgimp.diff +- Remove patch gmic-openmp.diff +- Remove patch gmic-overflow.diff +- Remove patch gmic-unstrip.diff +- Remove patch gmic-x11opts.diff +- Remove patch gmic-zart-qmake.diff + +------------------------------------------------------------------- +Mon Dec 21 11:48:48 UTC 2015 - msvec@suse.com + +- Update to gmic-1.6.8 + * https://discuss.pixls.us/t/release-of-gmic-1-6-8/470 + +------------------------------------------------------------------- +Mon Jul 6 18:04:16 CEST 2015 - kurt@garloff.de + +- Fix build of gmic with older 2.6 GIMP (SLE11). + +------------------------------------------------------------------- +Wed Jul 1 23:23:18 CEST 2015 - kurt@garloff.de + +- Update to gmic-1.6.5.0: + * https://www.flickr.com/groups/gmic/discuss/72157653514140862/ + * New commands: -label3d, -head, -files + * Improvements -repeat, -axes, -warn, -displacement, -files2video, + -apply_files + * Math parser now supports sqr() + * Bugfixes: Iain Fergusson denoising with selections and new layers, + video stream, -display garbage, -graph, -display_graph, -plot with + plot_type=3, 3d rendering, -camera with specified resolution. +- Update to gmic-1.6.3.1: + * https://www.flickr.com/groups/gmic/discuss/72157652079823575/ + * New commands: -pack, -x_landscape + * Improvements for 3d object rendering with z-buffer + * Shared gmicrc resource directory + * Math parser supporrts isfile(path), isdir(path) and fdate() now. + * libgmic now uses libpng, libtiff, libjpeg, libcurl, libfftw. + * Added some tooltips (gimp plugin) + * Bugfixes: Possible buffer overflows in plugins + +------------------------------------------------------------------- +Thu Apr 30 17:58:26 CEST 2015 - kurt@garloff.de + +- Update to gmic-1.6.2.0: + * https://www.flickr.com/groups/gmic/discuss/72157651409869115/ + * New commands -apply_timeout, -boxfilter, -serialize, -unserialize, + -fps, -transition. + * New filters Sequences / Spatial transition, Colors / Transfer colors + [advanced] + * Improved error message line numbers in -if .. -endif block. + * Improved -blur, -displacement, - input, -warp + * Compressed storage of custom commands + * Automatic filter updates on startup (gimp). + * Better progress bar (gimp) + * Bugfixes -command, .cimgz enidanness, -noarg, -error. +- Update to gmic-1.6.1.0: + * https://www.flickr.com/groups/gmic/discuss/72157650442201289/ + * Cleanups, restulting in faster code and less memory usage + * Download network files with cURL + * New command -split_colors + * New filters B&W/Engrave, improved preview + * Improvements with string substitution + * valgrind, gprof and other code analyzer improvments + * -solve can also solve with a matrix on the RHS + * Various bugfixes. +- Udpate to gmic-1.6.0.4: + * https://www.flickr.com/groups/gmic/discuss/72157649713920459/ + * New commands -array3d, -size3d, -imagegrid_hexagonal + * New filters Arrays & tiles / Grid [hexagonal], Arrays & Tiles / + Ministeck, Patterns / Crystal + * New command -delaunay3d, filter Artistic / Polygonize [delaunay] + * Improved -rgb2lab , -frame, -remove_pixels, -hostigram, + -equalize. + * Bugfixes for bbox with very very large images in -select and + -display. +------------------------------------------------------------------- +Thu Jan 8 14:57:41 CET 2015 - kurt@garloff.de + +- Update to gmic-1.6.0.3: + * New GIMP filters Degradation/Dirty, Rendering/Lightning, + Layers/Colors to Layers + * New commands rgb2int and int2rgb + * New preferred .gmz image list file format + * New -nlmeans denoising algorithm + * Improvements to -bilateral, -peronamalik_flow, -apply_parallel, + (= -ap), -split, -discard, -colormap, -displacement, vanvliet, + -belnd_median + * Bugfixes around -output codec, -eigen, -center3d, -normalize3d, + -split3d, -label +- Update to gmic-1.6.0.2: + * New -peronamalik_flow (diffusion smoothing) + * New -x_select_function1d and -x_color_curves + * New --guided, -cumulate + * New -apply_video, -video2files, -files2video, -average_video + * New -dct and -idct + * Improvements to -parallel + * Improving -fitscreen and tiff -output + * Improvements for -snapshot3d, -text, -fft, -ifft, -blur + * Major ZArt update + * Bugfixes for -deconvolve_fft, -bilateral, -gaussian, -srand +- Update to gmic-1.6.0.1: + * New: const(value) and button() typedefs to describe filters. + * Filter return status can be a list now. + * GIMP plug-in now has default capability to open display windows. + * New -x_segment (Contours/Extract Foreground). + * Double underscore vars are thread shared globals. + * New -x_select_color, -x_select_palette, -input_gpl, -x_colorize + * C++11 support in CImg, avoiding uneeded image copies + * Removed bool option for -endian + * Command --reverse now only reverses the selected images + * Bug fixes around -pass, -parallel, -quit, -equalize and + buffer overflow avoidance for plug-in code. + +------------------------------------------------------------------- +Sun Sep 7 12:08:18 CEST 2014 - kurt@garloff.de + +- Add more workarounds for limited openMP support in gcc-4.3. +- Disable openMP for gcc-4.8.1 (openSUSE-13.1, FC19/20); it produces + ICEs (see https://bugzilla.redhat.com/show_bug.cgi?id=1107972). + +------------------------------------------------------------------- +Sat Sep 6 23:59:57 CEST 2014 - kurt@garloff.de + +- Update to gmic-1.6.0.0: + * New commands -pass, -noargs, -is_image_arg, -gimp_error_preview, + -outputx (-ox), -names (-nms), -mul_channels. -oneminus. + * Source ~/.gmic on startup. + * Colors for gmic -h (with bash). + * New filters Film emulation / Various (color presets) and + Details / Mighty details. + * New filters for zart. + * Only support image datatypes with floats (thus remove -type), + but optionally do conversion in -input and -output. + * Supply boundary values in -map derived with + neumann/dirichlet/periodic. + * More -blend paramaters. + * -apply_pose3d renamed to -pose3d. + * Remove -background3d (use enahnced -display3d and -snapshot3d + to replace). + * Better exception handling (-onfail). + * gmic -h command suggests corrections for misspelled cmds. + * -median support thresholds. + * -threshold2 (-t2) renames to -inrange (-ir). + * Bugfixes for merging very large 3d objects, spurious EOF on + stdout with -output, maintaining shared state with -keep, + -erode and -dilate, line number of errors. +- Update to gmic-1.5.9.3: + * Official support for parallelization with OpenMP. + * New commands -variance_patch and -skeleton3d. + * New filter Artistic / Circle abstraction. + * Shortcuts for -and (-&) and -or (-|). + * Bugfix loading .tiff with 3 channels signed char. +- Update to gmic-1.5.9.2: + * New filter Artistic / Cutout. + * Speedup of complex math evaluations. + * Improvements on -circles3d and -primitives3d. + * Default window sizes (3d) now based on screen size. + * Adjust down GIMP preview size. +- Update to gmic-1.5.9.1: + * New command -seamcarve (Deformation / Seamcarve). + * New command -montage (Arrays & tiles / Montage). + * New command -inpaint_holes (Repair / Inpaint [holes]). + * -window now normalizes images individually. + * multipage TIFF output with is_multipage. + * remove slow image pointer check. + * -discard optimization. + * bug fix with -structuretensors (2d, scheme=1). +- Update to gmic-1.5.9.0: + * New command -blend_seamless (Layers / Blend [seamless]). + * New commands -sub_alpha and -montage. + * New filter Details / Split details [layers]. + * Larger default preview in GIMP plugin. + * Fixes for -split, -histogram, -equalize, -graph, -display +- Update to gmic-1.5.8.6: + * New plugins Film emulation / Add grain. + * New command -syntexturize (Patterns / Resynthesize texture). + * New command -fractalize (Artistic / Fractalize). + * New command -img2ascii (Arrays & tiles / Ascii art). + * New command -periodize_poisson (Patterns / Make seamless). + * New command -x_2048 -- launches famour 2048 game. + * Bug fixes for -minimal_path and -test + * @{-1,t} now always returns a string + * Disable sharing global vars between threads + * -uncommand and -command improvements +- Update to gmic-1.5.8.5 + * Support for PANDORE-5 (.pan) output files. + * Improve and optmize -replace-seq. + * Support for is_binary_data and maximum_sequence_length in + -compress-rle. + * Recoded and improved -text. + * Bugfixes for -output and math expressions starting with < or >. + +------------------------------------------------------------------- +Sat Mar 8 19:47:38 CET 2014 - kurt@garloff.de + +- Update to gmic-1.5.8.4: + * New command -imageblocks3d (and corresponding gimp plugin). + * New filter Degradations / Blur [depth-of-field]. + * Improved -endian command (accepts optional datatype). + * Tiff output type can be specified. + * -apply_files can now force filename extensions. + * ability to wait for threads run with -parallel. + * Math parser now understands med() and kth(). + * Reduce stack footprint of main parser. + * Request higher minimal stack size when possible. + * New output modes for Arrays & tiles / Extract objects. + * More imporvements to -inpaint. + * Fix line number displayed when error in .gmic file found. + * Fix thread destruction with non-wait mode and sub-commands. + +------------------------------------------------------------------- +Fri Feb 14 12:10:02 CET 2014 - kurt@garloff.de + +- Add logic to avoid excessive compilation time: + * Limit parallel make to available memory + * Set OBS _constraint to provide enough memory + * Reorder build targets to improve parallelism + +------------------------------------------------------------------- +Thu Feb 13 15:42:00 CET 2014 - kurt@garloff.de + +- Update to 1.5.8.3: + * New plug-in filter Frames / Frame[blur] + * Improvements: Less warnings on TIFFs, valgrind found bugfixes, + OS name in plug-in titlebar, slightly better -inpaint_patch, + more options for -taquin, significantly better -inpaint + * Fixed invalid mem access when reading command files + * Update reference manual. + +------------------------------------------------------------------- +Fri Jan 10 10:04:17 CET 2014 - kurt@garloff.de + +- Update to 1.5.8.2: + * New commands -puzzle, -map_sprites, -detect_skin + * Improvements to -bilateral amd debugging custom commands + * Fix bug with -display for images with NaNs +- Update to 1.5.8.1: + * New command -split_details + * New (GIMP plugin) filters Details/Details equalizer and + Repair/Smooth [skin]. + * -repair is merged with -inpaint + * Improve UI of -display and -select + * Fix crash of -bilateral on blank image + * Fixes for Ctrl+F in GIMP plugin + * 3D object display light source follows object zoom now +- Update to 1.5.8.0: + * Bugfixes, Optimizations, and Improvements + * Small API changes +- Update to 1.5.7.2: + * New commands -output_ggr, -at_line, -x_metaballs, -cubes3d, + -color_med, -x_bouncing, -mutex + * Fast marching algo available in -distance + * New substituion $"*" which does quoting to protect whitespace + * GIMP plugin filters Rendering/Gradient [custom shape] and + [from line] + * Improvements for -display, -ball and documentation + * Fix CPU eating of gmic display + * Compilation improvements (for clang++) +- Update to 1.5.7.1: + * Improve parallelization (-fft, -apply_parallel, + -apply_parallel_overlap) + + +------------------------------------------------------------------- +Fri Sep 13 17:09:48 CEST 2013 - kurt@garloff.de + +- Update to 1.5.7.0: + * Parallelization: Multiple threads can be used now, commands + -parallel, -apply_parallel, -apply_parallel{2,4,8} to use + it. Smoothing and sharpening filters use it already ... + * New: -image_integral, -autocrop_components, -bilateral + * Bugfixes: Added more randomness to the PRNG (gimp plugin), bug + in -polygon, in -output (% symbol), valgrind warings (false + positives actually) +- Update to 1.5.6.1: + * New filters 'Lights & Shadows / Drop shadow 3d', 'Colors / + Colorize comics' + * New commands '-pack_sprites', '-rprogress' + * Converted native commands '-haar' and '-ihaar' as custom + commands, re-organized filter tree sections (gimp), volumetric + images zoom in viewer keeps displaying z-coords. + * Bugfixes: raw files now correctly use unsigned int when requested + so (instead of unsigned short), -polygon, gimp non-interactive + mode. +- Update to 1.5.6.0: + * New command (and filter) -bokeh + * Math parser accepts 'j(dx,_dy,_dz,_dc,_interpolation,_boundary)' + * Commands '-deblur_richardsonlucy' and '-deblur_goldmeinel' + integrated into trunk. + * gimp plug-in external filter source management, optimiztion of + math parser, replace native -resize2x and 3x with custom + -scale2x and 3x, -blend_median recoded + * Integrate external filters in gimp plugin + * Bugfix: 3d rendering with parallel projection + +------------------------------------------------------------------- +Tue May 14 06:37:54 CEST 2013 - kurt@garloff.de + +- Disable GraphicsMagick features again (dependency hell). + +------------------------------------------------------------------- +Tue May 14 06:02:43 CEST 2013 - kurt@garloff.de + +- Include reference documentation (PDF) in -doc subpackage. + +------------------------------------------------------------------- +Tue May 14 05:39:29 CEST 2013 - kurt@garloff.de + +- Require same lib version from -devel package. +- Enable openmp, xshm, xrandr, opencv and magick features. + +------------------------------------------------------------------- +Sun May 12 00:55:20 CEST 2013 - kurt@garloff.de + +- Split off -zart and -gimp sub packages. + +------------------------------------------------------------------- +Fri May 10 01:16:53 CEST 2013 - kurt@garloff.de + +- Update to 1.5.5.2 +- Update to 1.5.5.1: + * Inpainting (-repair) to reconstruct image areas +- Update to 1.5.5.0: + * New logo (GREYC's Magic for Image Computing) + * New blending modes for -blend + * opencv allows requesting specific resolution for camera capture + * -alert box display + * improve image resolution for pdf files + * -richardson_lucy was a misnomer and is now called -deblur + * Various bugfixes +- Update to 1.5.4.0: + * Spanish translations + * Colors/Recolorize added + * -weave + * -compose_* deprecated, use -blend instead + * bugfixes +- Update to 1.5.3.0: + * _sort_str sorts in lexicographic order + * -echo_stdout and -echo_file + * -gimp_list_filters + * -symmetrice + * bug fixes +- Update to 1.5.2.2: + * multiple frames of animated GIF files supported + * interactive demo -x_quantize_rgb + * -uniform_distribution + * bugfixes +- Update to 1.5.2.0: + * Web interface G'MIC online http://gmicol.greyc.fr/ + * -text_pointcloud3d + * -vignette + * -ssd_patch + * -circle and -rectangle + * -x_pacman game + * -region_feature + * -average_color + * -histogram_pointwise + * -img2str + * -sprites3d + * -star3d + * -stars + * Bugfixes and Optimizations +- Update to 1.5.1.9: + * -med, -mad, -variance_noise, -resize_pow2, -denoise_haar + * Enhancement/Smooth [wavelets] + * -autocrop_seq + * -x_tetris + * Bugfixes + +------------------------------------------------------------------- +Wed Oct 19 15:37:32 CEST 2011 - garloff@suse.de + +- Split out libgmic1 and libgmic-devel subpackages. +- Update to 1.5.0.4: + * New features: -replace_nan, -min_patch/-max_patch, -rodilius. + * Bugfixes: -compose_alpha. + * Improvements: -gaussian. +- Update to 1.5.0.3: + * Improvements: P7 pink file format, image list name duplication limit, + -paper renamed to -texturize_paper. + * New features: -x_rubber3d, -texturize_canvas, Lylejk's painting + plug-in filter, -compose_alpha. + * Bug fixes: -select with feature_type=3. +- Update to 1.5.0.2: + * New features: -tensro2eigen, -eigen2tensor, space pauses -animate, + Solve Labyrith filter, managing empty images (-input 0), -maze + * Improvements: -split can split an image along several axes now + * Bug fixes: -ripple, -minimal_distance, @{x,-y} substitutions. +- Update to 1.5.0.1: + * New features: -output_pink3d, -ripple. + * Improvements: Remove 'beta' marker from man pages, reading BMP. + * Bug fixes: -convolve, -autocrop, modulo corrected for negative + numbers, -label (high connectivity mode). +- Update to 1.5.0.0: + * New features: -x_shadebobs, multi-line text parameter widget (plug-in), + paned GUI, faves copying in plug-in, allow specifying filename format + without filename extension, -uncase, compression of built-in commands, + gmic reference page documents convenient functions, -fire_edges. + * Improvements: Image copies have ~ appended, -mirror can now mirror + along several axes, outlined labels for -plot, -display_graph, labels + in command calls may reference several images, support for extended + ASCII chars, enlarge the size of preview window, chose RGBA channels + for plug-in filters. + * Bug fixes: -apply_channels, expand now displays last folder, -split, + faves. +- Update to 1.4.9.5: + * New features: -update, counter for documented commands, -x_blobs. + * Improvements: Kuwahara filter, more robust faves, GPT filter, + prefix for saved files in visualization module is now gmic_. +- Update to 1.4.9.4: + * New features: -distance (new mode), -gmicky, -minimal_path, + -x_minimal_path, -kuwahara, + * Improvements: -pointcloud3d, diplay start and end of shortened messages, + -input and -command now accept URLs, -select. + * Bug fixes: -ffast-math now safer, -pointcloud precision, remove update + files from temp dir. +- Update to 1.4.9.3: + * New features: -rgb2srgb, -srgb2rgb, -mdic, -discard, Plaid filter, + 3d colored object filter, -otsu, -hough, -x_hough, -houghsketchbw. + * Improvements: g++-4.6 compatibility, -quotify renamed to -quote, + -pointcloud, decrease verbosity in substitutions, -hardsketchbw, + -pointcloud3d. +- Update to 1.4.9.2: + * Improvments: package libgmic and header in .deb package, -flood, -label. + * Bug fixes: -round, 'Mirrored array' filter. +- Update to 1.4.9.1: + * New features: -svd, -diagonal matrix functions. + * Improvements: Progress bar disabling in plug-in. + * Bug fixes: -split, -dijkstra ... allow rounding values. +- Update to 1.4.9.0: + * New features: Stained glass, plasma filters, input_network command, + poker tournament score board, external filter sources, -quotify. + * Improvements: multi-page TIFF support, -displacement w/ negative + smoothness (anisotropic), raw pixel types, fave management, -return. + * A number of smaller bug fixes. +- Update to 1.4.8.3: + * New features: -onfail, -srand, -reset, -replace. + * Improvements: More restrictive syntax for -do, -while, -if, ..., + -r3d shortcut, code examples with gmic -h command and on reference + page, removed HTML documentation from tar balls, -streamline3d, + -trisolve, -sharpen, real global vars, better reference doc (at + http://gmic.sourceforge.net/reference.shtml). + * Bug fixes: -break, -sort, -resize3x, -display, -equalize, -histogram, + -solve, -normalize. +- Update to 1.4.8.2: + * Bug corrections: -isosurface3d, -isoline3d, -extrude3d. + * New features: PINK extensions (.pgm), P1+P4 .pnm files, new filter + Light&Shadows/Light glow. + * Improvements: Avoid using xshm X11 extension, -gpt command. +- Update to 1.4.8.1: + * New features: (Partial) support of MINC2 files. + * Bug fixes: -append, image rations, -split, -text, '\r' handling. +- Update to 1.4.8.0: + * Improvements: -break, -continue, -return control flow, maintain some + special chars in variable names. + * Bug fixes: segfault reading filter zoon factor, display bugs in -shell + mode, DICOM format (3d), diplay of image lists and visualization windows + for very small images. +- Update to 1.4.7.4: + * New features: -distance with custom metric, -label threshold, interactive + navigation through image lists, HSV equalizer. + * Improvements: Auto-completion, class name for windows, -display_array, + -append. + * Bug fixes: Manage mouse wheel again in -animate. +- Update to 1.4.7.3: + * Bug corrections: -graph, plug-in with gimp 2.7.x + * New features: -display_array, Grain merge and Grain extract layer mode, + -distance metrics, -label, 3d view for 3d volumetric images (Ctrl-V). + * Improvements: Image display, -split. +- Update to 1.4.7.2: + * G'MIC interpreter: Substitution expressions '${>}' and '${' and '$<', + '@*', command line with spaces in filenames handling, large 3d object + handling. + * G'MIC commands: -split improvement, .off 3D file handling, new + -pointcloud3d, -colorcube3d, updated -histogram3d, -primitive3d, + -primitives3d. Bugfix for -primitive3d, -resize, -graph. New -gpt. +- Update to 1.4.7.1: + * Significant optimization in managing named variables, introduction of + global variables (start with _). Improved image selection. +- Update to 1.4.7.0: + * Significant cleanups. + +------------------------------------------------------------------- +Fri Dec 10 10:32:44 CET 2010 - garloff@suse.de + +- Update to 1.4.5.2: + * Raised precision for the sliders in the G'MIC for GIMP +- Update to 1.4.5.0: + * New command '-display_graph' that renders a graph plot + * New in GIMP plug-in : 'Rendering/Equation plot' + * Bugfixes: '-convolve', '-correlate', '-erode', '-dilate'. + Added boolean parameter for the computation of normalized versions. + * Bugifixes: small bugs in '-grid', '-graph' and '-plot'. + * New in GIMP plug-in: 'Various/Do nothing', 'Polka dots' +- Update to 1.4.4.2: + * Layers are now named after the G'MIC command generating them +- Update to 1.4.4.0: + * New filters 'Rendering/3d lathing', 'Contours/Skeleton' + * Improvement of 3d rendering capabilities in the G'MIC plug-in. + * Improvement of the 'Sequence' folder. + * Bugfixes in the internal G'MIC engine, in particula '-break'. +- Update to 1.4.3.0: + * Small improvements over 1.4.2.0 +- Update to 1.4.2.0: + * Many bug fixes, and some speed improvements. + * Some new options in the 3d objects filters. +- Update to 1.4.1.0: + * Bugfixes: Display of 3d objects containing point primitives, + bad memory access in command '-input', typos in various + error/warning messages. + * Features: '-gyroid3d', '-texturize3d', new default colormaps + for '-map' and '-index' (8 in total) : hot, jet, cube, ..., + '-label_points3d' + * New in the GIMP plug-in : sphere and gyroid. +- Update to 1.4.0.0: + - New native commands '-trisolve', '-camera', '-rotation3d' + - New custom commands ('-tunnel','-apply_camera','-function1d', + 'chessboard',...). New internal timer with a ms precision. + - New in the GIMP plug-in: RGB/YCbCr/Lab curves, Tunnel effect, + Tone Mapping and Chessboard filters. + - The command line version of G'MIC can now manage the webcam, + through the use of the OpenCV library. + - Small bugfixes and optimization. +* Update to 1.3.9.0: + - Small bugfixes and optimizations +* Update to 1.3.8.0: + - Various bugfixes +* Update to 1.3.7.2: + - Simplify the variable management in the G'MIC language + - Some small bugfixes + - Slightly reduced memory footprint of the interpreter + - Updates to The technical reference documentation +* Update to 1.3.7.1: + - Minor bugfixes +* Update to 1.3.7.0: + - Bugfixes +* Update to 1.3.6.0: + - Small improvements and optimizations: Better substitution mechanism + (with labels, making filter writing more comfortable), new ('-grid') + and improved commands + - Demo for new label mechanism: gmic -x_jawbreaker + +------------------------------------------------------------------- +Fri Jun 25 10:59:01 CEST 2010 - garloff@suse.de + +- Update to 1.3.5.7: + * Final stable version +- Update to 1.3.5.6: + * Maximize preview button (plugin dialog) + * New filters in plugin + * Small optimizations +- Update to 1.3.5.5: + * Processing engine now allows custom functions w/ return values + * Scrollbar in plugin parameters dialog +- Update to 1.3.5.3: + * deriche command + * Improved stability +- Update to 1.3.5.1: + * Optimize memory usage +- Update to 1.3.5.0: + * Quick preview toggling + * Median filtering + * Layers/Shape average + * Internal changes and optimizations +- Update to 1.3.4.1: + * Minor bug fixes + +------------------------------------------------------------------- +Sun Mar 21 15:40:07 CET 2010 - garloff@suse.de + +- Fix GraphicsMagick++ vs. (Image)Magick++ mess; work with either, + not both. + +------------------------------------------------------------------- +Fri Mar 19 01:20:57 CET 2010 - garloff@suse.de + +- Update do gmic-1.3.4.0: + * gmic lang interpreter stabilized + * Minor fixes and improvements + * Major performance gains + * Smarter preview + * gimp plugin more in line with the rest +- Drop parallel make patch (is upstream). +- Compile flag -fno-tree-pre now determined by detected compiled + version (4.3*). + +------------------------------------------------------------------- +Mon Nov 23 08:48:32 CET 2009 - garloff@suse.de + +- Parallel make. + +------------------------------------------------------------------- +Sun Nov 22 22:02:20 CET 2009 - garloff@suse.de + +- Update to 1.3.2.9: + * Non-interactive mode possible + * Bug fixes and new modes + +------------------------------------------------------------------- +Mon Jul 6 19:56:03 CEST 2009 - garloff@suse.de + +- Update to 1.3.2.0: + * Documentation improvements. + * Better image transfer with gimp. + +------------------------------------------------------------------- +Tue Mar 31 10:41:35 CEST 2009 - garloff@suse.de + +- Update to 1.3.1.1. + +------------------------------------------------------------------- +Mon Mar 2 12:02:43 CET 2009 - garloff@suse.de + +- Fix compiler overflow warning. + +------------------------------------------------------------------- +Fri Feb 27 11:19:09 CET 2009 - garloff@suse.de + +- Initial creation of package. (1.3.0.3) + diff --git a/gmic.spec b/gmic.spec new file mode 100644 index 0000000..7aac9cc --- /dev/null +++ b/gmic.spec @@ -0,0 +1,278 @@ +# +# spec file for package gmic +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if %{pkg_vcmp krita >= 5} +%bcond_without krita5 +%else +%bcond_with krita5 +%endif + +%if %{pkg_vcmp gimp >= 2.99} +%define gimp_suffix 3 +%global _gimpplugindir %(gimptool-2.99 --gimpplugindir)/plug-ins/ +%else +%global _gimpplugindir %(gimptool-2.0 --gimpplugindir)/plug-ins/ +%endif + +%if %{with krita5} +%define hostapps gimp%{?gimp_suffix} +%else +%define hostapps gimp%{?gimp_suffix} krita +%endif + +%define gmic_qt_options -DENABLE_SYSTEM_GMIC=ON -DENABLE_DYNAMIC_LINKING=ON + +%define gmic_datadir %{_datadir}/gmic + +Name: gmic +Version: 3.4.2 +Release: 0 +Summary: GREYC's Magick for Image Computing (denoise and others) +# gmic-qt is GPL-3.0-or-later, zart is CECILL-2.0, libgmic and cli program are +# CECILL-2.1 +License: CECILL-2.1 +URL: https://gmic.eu +# Git URL: https://github.com/dtschump/gmic +Source0: https://gmic.eu/files/source/gmic_%{version}.tar.gz +# PATCH-FIX-UPSTREAM krita.patch - Will be sent upstream soon. For now https://github.com/darix/gmic-qt/tree/krita5 +Patch0: krita5.patch +# PATCH-FEATURE-OPENSUSE +Patch1: 0001-Find-the-local-gmic-library.patch +# +# SECTION pkg_vcmp +# +# Those 2 are used for the pkg_vcmp conditionals above and also the rich expressions in the BuildRequires below +# +BuildRequires: gimp +BuildRequires: krita +# +# /SECTION +# +BuildRequires: cmake >= 3.14.0 +BuildRequires: dos2unix +BuildRequires: extra-cmake-modules +BuildRequires: fftw3-threads-devel +BuildRequires: hicolor-icon-theme +BuildRequires: pkgconfig +BuildRequires: update-desktop-files +BuildRequires: (krita-devel if krita >= 5) +BuildRequires: (pkgconfig(gimp-2.0) if gimp < 2.99) +BuildRequires: (pkgconfig(gimp-3.0) if gimp >= 2.99) +BuildRequires: cmake(KF5CoreAddons) +BuildRequires: cmake(Qt5Core) +BuildRequires: cmake(Qt5Gui) +BuildRequires: cmake(Qt5LinguistTools) +BuildRequires: cmake(Qt5Network) +BuildRequires: cmake(Qt5Widgets) +BuildRequires: cmake(Qt5Xml) +BuildRequires: pkgconfig(OpenEXR) +BuildRequires: pkgconfig(fftw3) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(libheif) +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libtiff-4) +BuildRequires: pkgconfig(opencv4) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb-shm) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xproto) +BuildRequires: pkgconfig(xrandr) +BuildRequires: pkgconfig(zlib) +Requires: gmic-data = %{version} + +%description +G'MIC is a framework for image processing, providing +several different user interfaces to convert/manipulate/filter/visualize +generic image datasets, from 1d scalar signals to 3d+t sequences of +multi-spectral volumetric images. + +%package -n libgmic3 +Summary: Shared library that belongs to gmic +License: CECILL-2.1 + +%package -n libgmic-devel +Summary: Header and library from gmic for use in other C++ projects +License: CECILL-2.1 +Requires: libgmic3 = %{version} + +%description -n libgmic3 +This shared library allows using gmic functionality from other +programs. + +%description -n libgmic-devel +Header and library from gmic to needed to develop C++ code that +uses the gmic functionality provided by the gmic library. + +%package -n gimp-plugin-gmic +Summary: GMIC plugin for gimp +License: GPL-3.0-or-later +Requires: gmic-data = %{version} +%requires_eq gimp +# This package was only available in the 'graphics' repo +Provides: gmic-gimp = %{version} +Obsoletes: gmic-gimp < %{version} + +%description -n gimp-plugin-gmic +This is a plugin for gimp that exposes many of the nice gmic features +for interactive use in gimp. + +%package -n krita-plugin-gmic +Summary: GMIC plugin for krita +License: GPL-3.0-or-later +Requires: gmic-data = %{version} +%requires_eq krita + +%description -n krita-plugin-gmic +This is a plugin for krita to provide gmic features. + +%package bash-completion +Summary: Bash completion for gmic +License: CECILL-2.1 +Requires: bash-completion +Supplements: (%{name} and bash-completion) +BuildArch: noarch + +%description bash-completion +This package contains the bash completion command for gmic. + +%package data +Summary: Shared data files for the various gmic frontends +License: CECILL-2.1 +BuildArch: noarch + +%description data +This package contains shared data files for the various gmic frontends. + +%prep +%autosetup -p1 +dos2unix src/gmic_libc.* + +%build +# Build gmic +# Starting with gmic 3.1.0, the gmic dev replaced their CMake build system with a non-configurable Makefile... +sed -i 's#LIB ?= lib#LIB ?= %{_lib}#' src/Makefile + +# Breaks compilation for a couple archs +sed -i 's#-mtune=generic##' src/Makefile + +# Broken rpath +sed -i 's# -Wl,-rpath,.##' src/Makefile + +# The file is moved post-install in a directory not owned by gimp +sed -i 's#/usr/lib/gimp/2.0/plug-ins#%{gmic_datadir}#' src/gmic_stdlib.gmic + +# There's no concept of build order in the crappy Makefile provided +EXTRA_CFLAGS='%{optflags}' NOSTRIP=1 %__make lib %{?_smp_mflags} +EXTRA_CFLAGS='%{optflags}' NOSTRIP=1 %__make cli_shared %{?_smp_mflags} + +# Build gmic{_gimp|_krita}_qt +pushd gmic-qt + +%cmake %{gmic_qt_options} -DGMIC_QT_HOST=none +%cmake_build + +cd .. + +for hostapp in %{hostapps} ; do +%cmake %{gmic_qt_options} -DGMIC_QT_HOST=${hostapp} +%cmake_build + +cd .. +done + +%if %{with krita5} +%cmake_kf5 -d plugin-build -- -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir} %{gmic_qt_options} -DGMIC_QT_HOST=krita-plugin -DCMAKE_BUILD_TYPE=RelWithDebInfo + +%cmake_build + +cd .. +%endif +popd + +%install +%make_install + +# As planned, only providing a Makefile partially works... +install -m 0644 src/CImg.h %{buildroot}%{_includedir} + +# Install icons +for size in 16 32 48 64; do + install -Dm 0644 gmic-qt/icons/application/${size}-gmic_qt.png %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/gmic_qt.png +done +install -Dm 0644 gmic-qt/icons/application/gmic_qt.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gmic_qt.svg + +%if %{with krita5} +DESTDIR=%{buildroot} cmake --install gmic-qt/plugin-build +%else +# krita plugin +install -m 0755 gmic-qt/build/gmic_krita_qt %{buildroot}%{_bindir}/gmic_krita_qt +%endif + +%suse_update_desktop_file -c gmic_qt "G'Mic Qt" "G'MIC Qt GUI" "gmic_qt %%F" gmic_qt "Qt;Graphics;Photography;" + +# This manpage isn't translated +rm %{buildroot}%{_mandir}/fr/man1/gmic.1* + +# qt_gmic +pushd gmic-qt +install -m 0755 build/gmic_qt %{buildroot}%{_bindir}/gmic_qt + +# gimp plugin +install -m 0755 build/gmic_gimp_qt %{buildroot}%{_gimpplugindir}/gmic_gimp_qt +popd + +%ldconfig_scriptlets -n libgmic3 + +%files +%doc README gmic-qt/README.md +%{_bindir}/gmic +%{_bindir}/gmic_qt +%{_mandir}/man1/gmic.1%{?ext_man} +%{_datadir}/applications/gmic_qt.desktop +%{_datadir}/icons/hicolor/*/apps/gmic_qt.png +%{_datadir}/icons/hicolor/scalable/apps/gmic_qt.svg + +%files data +%{gmic_datadir}/ + +%files -n gimp-plugin-gmic +%{_gimpplugindir}/ + +%files -n krita-plugin-gmic +%if %{with krita5} +%{_kf5_libdir}/kritaplugins/krita_gmic_qt.so +%else +%{_bindir}/gmic_krita_qt +%endif + +%files -n libgmic3 +%license COPYING +%{_libdir}/libgmic.so.* + +%files -n libgmic-devel +%{_includedir}/CImg.h +%{_includedir}/gmic.h +%{_includedir}/gmic_libc.h +%{_libdir}/libgmic.so + +%files bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/gmic + +%changelog diff --git a/gmic_3.4.0.tar.gz b/gmic_3.4.0.tar.gz new file mode 100644 index 0000000..4dca155 --- /dev/null +++ b/gmic_3.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df6f087af3db935d5788f7fa20c4fc46a426991919db91853b0db1c9e7cd792a +size 18020463 diff --git a/gmic_3.4.2.tar.gz b/gmic_3.4.2.tar.gz new file mode 100644 index 0000000..b4cbff3 --- /dev/null +++ b/gmic_3.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9abd8377693715f87104bdbe077d45ecb00cf19f57c29f425eacda07c745fe8a +size 18001488 diff --git a/krita5.patch b/krita5.patch new file mode 100644 index 0000000..f63dc9f --- /dev/null +++ b/krita5.patch @@ -0,0 +1,1442 @@ +From c4b6796080d5c0f76b64fee06a38d285ab462a75 Mon Sep 17 00:00:00 2001 +From: Christophe Marin +Date: Fri, 28 Jun 2024 09:46:58 +0200 +Subject: [PATCH] Krita 5 plugin support + +Origin: https://github.com/amyspark/gmic + +Rebased for gmic 3.4.0 +--- + gmic-qt/CMakeLists.txt | 68 ++++- + gmic-qt/gmic_krita_qt.desktop | 9 + + gmic-qt/src/DialogSettings.cpp | 33 ++- + .../src/FilterParameters/BoolParameter.cpp | 2 + + .../src/FilterParameters/FloatParameter.cpp | 3 +- + gmic-qt/src/FilterParameters/IntParameter.cpp | 2 + + .../src/FilterParameters/NoteParameter.cpp | 2 + + .../FilterParameters/SeparatorParameter.cpp | 2 + + .../src/FilterSelector/FiltersPresenter.cpp | 2 +- + gmic-qt/src/Globals.h | 19 ++ + gmic-qt/src/GmicProcessor.cpp | 5 + + gmic-qt/src/GmicProcessor.h | 1 + + gmic-qt/src/GmicQt.cpp | 6 +- + gmic-qt/src/HeadlessProcessor.cpp | 5 +- + .../src/Host/KritaPlugin/gmicqttoolplugin.cpp | 233 ++++++++++++++++++ + .../src/Host/KritaPlugin/gmicqttoolplugin.h | 55 +++++ + .../Host/KritaPlugin/gmicqttoolplugin.json | 9 + + gmic-qt/src/Host/KritaPlugin/host.cpp | 195 +++++++++++++++ + gmic-qt/src/Host/None/JpegQualityDialog.cpp | 6 +- + gmic-qt/src/LanguageSettings.cpp | 9 +- + gmic-qt/src/MainWindow.cpp | 52 +++- + gmic-qt/src/MainWindow.h | 2 + + gmic-qt/src/Settings.cpp | 10 +- + gmic-qt/src/Tags.cpp | 6 +- + gmic-qt/src/Widgets/InOutPanel.cpp | 2 + + gmic-qt/src/Widgets/InOutPanel.h | 2 + + gmic-qt/src/Widgets/ProgressInfoWindow.cpp | 4 + + gmic-qt/src/Widgets/ProgressInfoWindow.h | 2 + + gmic-qt/ui/dialogsettings.ui | 2 +- + 29 files changed, 716 insertions(+), 32 deletions(-) + create mode 100644 gmic-qt/gmic_krita_qt.desktop + create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp + create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.h + create mode 100644 gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.json + create mode 100644 gmic-qt/src/Host/KritaPlugin/host.cpp + +diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt +index 47face8..0641f4c 100644 +--- a/gmic-qt/CMakeLists.txt ++++ b/gmic-qt/CMakeLists.txt +@@ -30,7 +30,7 @@ endif() + + message("Build type is " ${CMAKE_BUILD_TYPE}) + +-set (GMIC_QT_HOST "gimp" CACHE STRING "Define for which host gmic-qt will be built: gimp, gimp3 (experimental), none, paintdotnet or 8bf.") ++set (GMIC_QT_HOST "gimp" CACHE STRING "Define for which host gmic-qt will be built: gimp, gimp3 (experimental), krita-plugin, none, paintdotnet or 8bf.") + if (${GMIC_QT_HOST} STREQUAL "none") + message("Building standalone version.") + else() +@@ -701,6 +701,70 @@ if (${GMIC_QT_HOST} STREQUAL "gimp" OR ${GMIC_QT_HOST} STREQUAL "gimp3") + ) + install(TARGETS gmic_gimp_qt RUNTIME DESTINATION "${GIMP_PKGLIBDIR}/plug-ins/gmic_gimp_qt") + ++elseif (${GMIC_QT_HOST} STREQUAL "krita-plugin") ++ set(MIN_FRAMEWORKS_VERSION 5.44.0) ++ ++ find_package(ECM 5.22 REQUIRED NOMODULE) ++ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) ++ ++ include(KDEInstallDirs) ++ include(KDECMakeSettings) ++ ++ if (ANDROID) ++ set (KRITA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}) ++ else() ++ set (KRITA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kritaplugins) ++ endif() ++ ++ find_package(KF5 ${MIN_FRAMEWORKS_VERSION} REQUIRED COMPONENTS ++ CoreAddons ++ ) ++ ++ message(STATUS "Looking for Krita QMic libraries in: ${CMAKE_PREFIX_PATH}") ++ ++ find_library(KIS_IMAGE_INTERFACE_LIBRARY ++ NAMES kritaqmicinterface ++ REQUIRED) ++ ++ find_path(KIS_IMAGE_INTERFACE_DIR ++ NAMES kis_qmic_plugin_interface.h ++ REQUIRED) ++ ++ set_package_properties(kritaqmicinterface PROPERTIES ++ URL "http://www.krita.org" ++ DESCRIPTION "Krita GMic core library" ++ ) ++ ++ set (gmic_qt_SRCS ${gmic_qt_SRCS} src/Host/KritaPlugin/host.cpp src/Host/KritaPlugin/gmicqttoolplugin.cpp) ++ set (gmic_qt_SRCS ${gmic_qt_SRCS} ) ++ qt5_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS}) ++ add_definitions(-DGMIC_HOST=krita-plugin) ++ add_definitions(-D_GMIC_QT_DISABLE_THEMING_) ++ add_definitions(-D_GMIC_QT_CONSENT_TO_UPDATE_FIRST_) ++ add_definitions(-D_GMIC_QT_DISABLE_TRANSLATION_) ++ add_definitions(-D_GMIC_USE_HOSTED_SETTINGS_) ++ add_library(krita_gmic_qt MODULE ${gmic_qt_SRCS} ${gmic_qt_QRC} ${qmic_qt_QM}) ++ target_include_directories( ++ krita_gmic_qt ++ PUBLIC ++ ${KIS_IMAGE_INTERFACE_DIR} ++ ) ++ target_link_libraries( ++ krita_gmic_qt ++ PRIVATE ++ ${gmic_qt_LIBRARIES} ++ ${KIS_IMAGE_INTERFACE_LIBRARY} ++ KF5::CoreAddons ++ ) ++ if (ANDROID) ++ target_link_libraries( ++ krita_gmic_qt ++ PRIVATE ++ log ++ ) ++ endif() ++ install(TARGETS krita_gmic_qt DESTINATION ${KRITA_PLUGIN_INSTALL_DIR}) # plugin ++ + elseif (${GMIC_QT_HOST} STREQUAL "none") + + set (gmic_qt_SRCS ${gmic_qt_SRCS} +@@ -783,7 +847,7 @@ elseif (${GMIC_QT_HOST} STREQUAL "8bf") + + else() + +- message(FATAL_ERROR "GMIC_QT_HOST is not defined as gimp, gimp3, none, paintdotnet or 8bf") ++ message(FATAL_ERROR "GMIC_QT_HOST is not defined as gimp, gimp3, krita-plugin, none, paintdotnet or 8bf") + + endif() + +diff --git a/gmic-qt/gmic_krita_qt.desktop b/gmic-qt/gmic_krita_qt.desktop +new file mode 100644 +index 0000000..579d427 +--- /dev/null ++++ b/gmic-qt/gmic_krita_qt.desktop +@@ -0,0 +1,9 @@ ++[Desktop Entry] ++Name=gmic_krita_qt ++Exec=gmic_krita_qt ++GenericName=G'Mic plugin for Krita ++Comment=G'Mic plugin for Krita ++Type=Application ++Icon=gmic_krita_qt ++Categories=Qt;KDE;Graphics; ++StartupNotify=false +diff --git a/gmic-qt/src/DialogSettings.cpp b/gmic-qt/src/DialogSettings.cpp +index 6c1e6b9..29328c4 100644 +--- a/gmic-qt/src/DialogSettings.cpp ++++ b/gmic-qt/src/DialogSettings.cpp +@@ -56,11 +56,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D + #ifdef _GMIC_QT_DEBUG_ + ui->cbUpdatePeriodicity->addItem(tr("At launch (debug)"), QVariant(0)); + #endif +- for (int i = 0; i < ui->cbUpdatePeriodicity->count(); ++i) { +- if (Settings::updatePeriodicity() == ui->cbUpdatePeriodicity->itemData(i).toInt()) { +- ui->cbUpdatePeriodicity->setCurrentIndex(i); +- } +- } ++ ui->cbUpdatePeriodicity->setCurrentIndex(ui->cbUpdatePeriodicity->findData(Settings::updatePeriodicity())); + + ui->outputMessages->setToolTip(tr("Output messages")); + ui->outputMessages->addItem(tr("Quiet (default)"), (int)OutputMessageMode::Quiet); +@@ -81,9 +77,12 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D + + ui->rbLeftPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Left); + ui->rbRightPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Right); +- const bool savedDarkTheme = QSettings().value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool(); ++ const bool savedDarkTheme = GMIC_SETTINGS_INLINE.value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool(); + ui->rbDarkTheme->setChecked(savedDarkTheme); + ui->rbDefaultTheme->setChecked(!savedDarkTheme); ++#ifdef _GMIC_QT_DISABLE_THEMING_ ++ ui->groupBoxTheme->setEnabled(false); ++#endif + ui->cbNativeColorDialogs->setChecked(Settings::nativeColorDialogs()); + ui->cbNativeColorDialogs->setToolTip(tr("Check to use Native/OS color dialog, uncheck to use Qt's")); + ui->cbNativeFileDialogs->setChecked(Settings::nativeFileDialogs()); +@@ -95,19 +94,33 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D + + connect(ui->pbOk, &QPushButton::clicked, this, &DialogSettings::onOk); + connect(ui->rbLeftPreview, &QRadioButton::toggled, this, &DialogSettings::onRadioLeftPreviewToggled); ++#ifdef _GMIC_QT_DISABLE_UPDATES_ ++ ui->pbUpdate->setEnabled(false); ++#else + connect(ui->pbUpdate, &QPushButton::clicked, this, &DialogSettings::onUpdateClicked); ++#endif ++#ifdef _GMIC_QT_DISABLE_UPDATES_ ++ ui->cbUpdatePeriodicity->setEnabled(false); ++#else + connect(ui->cbUpdatePeriodicity, QOverload::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onUpdatePeriodicityChanged); ++#endif + connect(ui->labelPreviewLeft, &ClickableLabel::clicked, ui->rbLeftPreview, &QRadioButton::click); + connect(ui->labelPreviewRight, &ClickableLabel::clicked, ui->rbRightPreview, &QRadioButton::click); + connect(ui->cbNativeColorDialogs, &QCheckBox::toggled, this, &DialogSettings::onColorDialogsToggled); + connect(ui->cbNativeFileDialogs, &QCheckBox::toggled, this, &DialogSettings::onFileDialogsToggled); + connect(Updater::getInstance(), &Updater::updateIsDone, this, &DialogSettings::enableUpdateButton); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + connect(ui->rbDarkTheme, &QRadioButton::toggled, this, &DialogSettings::onDarkThemeToggled); ++#endif + connect(ui->cbShowLogos, &QCheckBox::toggled, this, &DialogSettings::onVisibleLogosToggled); + connect(ui->cbPreviewZoom, &QCheckBox::toggled, this, &DialogSettings::onPreviewZoomToggled); + connect(ui->sbPreviewTimeout, QOverload::of(&QSpinBox::valueChanged), this, &DialogSettings::onPreviewTimeoutChange); + connect(ui->outputMessages, QOverload::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onOutputMessageModeChanged); ++#ifdef _GMIC_QT_DISABLE_UPDATES_ ++ ui->cbNotifyFailedUpdate->setEnabled(false); ++#else + connect(ui->cbNotifyFailedUpdate, &QCheckBox::toggled, this, &DialogSettings::onNotifyStartupUpdateFailedToggle); ++#endif + + #if QT_VERSION_GTE(6, 0, 0) + ui->cbHighDPI->hide(); +@@ -117,9 +130,14 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D + connect(ui->cbHighDPI, &QCheckBox::toggled, this, &DialogSettings::onHighDPIToggled); + #endif + ++#ifdef _GMIC_QT_DISABLE_TRANSLATION_ ++ ui->languageSelector->setEnabled(false); ++#else + ui->languageSelector->selectLanguage(Settings::languageCode()); + ui->languageSelector->enableFilterTranslation(Settings::filterTranslationEnabled()); ++#endif + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + QPalette p = ui->cbNativeColorDialogs->palette(); + p.setColor(QPalette::Text, Settings::CheckBoxTextColor); +@@ -136,6 +154,7 @@ DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::D + ui->cbNotifyFailedUpdate->setPalette(p); + ui->cbHighDPI->setPalette(p); + } ++#endif + ui->pbOk->setFocus(); + ui->tabWidget->setCurrentIndex(0); + } +@@ -157,7 +176,7 @@ void DialogSettings::onOk() + + void DialogSettings::done(int r) + { +- QSettings settings; ++ GMIC_SETTINGS(settings); + ui->sources->saveSettings(); + Settings::save(settings); + QDialog::done(r); +diff --git a/gmic-qt/src/FilterParameters/BoolParameter.cpp b/gmic-qt/src/FilterParameters/BoolParameter.cpp +index ffa324e..a9dfb04 100644 +--- a/gmic-qt/src/FilterParameters/BoolParameter.cpp ++++ b/gmic-qt/src/FilterParameters/BoolParameter.cpp +@@ -64,12 +64,14 @@ bool BoolParameter::addTo(QWidget * widget, int row) + _checkBox = new QCheckBox(widget); + _checkBox->setChecked(_value); + _label = new QLabel(_name, widget); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + QPalette p = _checkBox->palette(); + p.setColor(QPalette::Text, Settings::CheckBoxTextColor); + p.setColor(QPalette::Base, Settings::CheckBoxBaseColor); + _checkBox->setPalette(p); + } ++#endif + _grid->addWidget(_label, row, 0, 1, 1); + _grid->addWidget(_checkBox, row, 1, 1, 2); + connectCheckBox(); +diff --git a/gmic-qt/src/FilterParameters/FloatParameter.cpp b/gmic-qt/src/FilterParameters/FloatParameter.cpp +index fb271f0..c8aa32b 100644 +--- a/gmic-qt/src/FilterParameters/FloatParameter.cpp ++++ b/gmic-qt/src/FilterParameters/FloatParameter.cpp +@@ -73,13 +73,14 @@ bool FloatParameter::addTo(QWidget * widget, int row) + _slider->setMinimumWidth(SLIDER_MIN_WIDTH); + _slider->setRange(0, SLIDER_MAX_RANGE); + _slider->setValue(static_cast(SLIDER_MAX_RANGE * (_value - _min) / (_max - _min))); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + QPalette p = _slider->palette(); + p.setColor(QPalette::Button, QColor(100, 100, 100)); + p.setColor(QPalette::Highlight, QColor(130, 130, 130)); + _slider->setPalette(p); + } +- ++#endif + _spinBox = new CustomDoubleSpinBox(widget, _min, _max); + _spinBox->setSingleStep(double(_max - _min) / 100.0); + _spinBox->setValue((double)_value); +diff --git a/gmic-qt/src/FilterParameters/IntParameter.cpp b/gmic-qt/src/FilterParameters/IntParameter.cpp +index 2af87cb..bc0f77c 100644 +--- a/gmic-qt/src/FilterParameters/IntParameter.cpp ++++ b/gmic-qt/src/FilterParameters/IntParameter.cpp +@@ -81,12 +81,14 @@ bool IntParameter::addTo(QWidget * widget, int row) + + _spinBox = new CustomSpinBox(widget, _min, _max); + _spinBox->setValue(_value); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + QPalette p = _slider->palette(); + p.setColor(QPalette::Button, QColor(100, 100, 100)); + p.setColor(QPalette::Highlight, QColor(130, 130, 130)); + _slider->setPalette(p); + } ++#endif + _grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1); + setTextSelectable(_label); + _grid->addWidget(_slider, row, 1, 1, 1); +diff --git a/gmic-qt/src/FilterParameters/NoteParameter.cpp b/gmic-qt/src/FilterParameters/NoteParameter.cpp +index e576b0f..be469de 100644 +--- a/gmic-qt/src/FilterParameters/NoteParameter.cpp ++++ b/gmic-qt/src/FilterParameters/NoteParameter.cpp +@@ -88,12 +88,14 @@ bool NoteParameter::initFromText(const QString & /* filterName */, const char * + _text.remove(QRegularExpression("^\"")).remove(QRegularExpression("\"$")).replace(QString("\\\""), "\""); + _text.replace(QString("\\n"), "
"); + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + _text.replace(QRegularExpression("color\\s*=\\s*\"purple\""), QString("color=\"#ff00ff\"")); + _text.replace(QRegularExpression("foreground\\s*=\\s*\"purple\""), QString("foreground=\"#ff00ff\"")); + _text.replace(QRegularExpression("color\\s*=\\s*\"blue\""), QString("color=\"#9b9bff\"")); + _text.replace(QRegularExpression("foreground\\s*=\\s*\"blue\""), QString("foreground=\"#9b9bff\"")); + } ++#endif + + _text.replace(QRegularExpression("color\\s*=\\s*\""), QString("style=\"color:")); + _text.replace(QRegularExpression("foreground\\s*=\\s*\""), QString("style=\"color:")); +diff --git a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp +index fad7b0a..7f6d317 100644 +--- a/gmic-qt/src/FilterParameters/SeparatorParameter.cpp ++++ b/gmic-qt/src/FilterParameters/SeparatorParameter.cpp +@@ -58,9 +58,11 @@ bool SeparatorParameter::addTo(QWidget * widget, int row) + _frame->setSizePolicy(sizePolicy); + _frame->setFrameShape(QFrame::HLine); + _frame->setFrameShadow(QFrame::Sunken); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + _frame->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 2px solid rgb(160,160,160);}"); + } ++#endif + _grid->addWidget(_frame, row, 0, 1, 3); + return true; + } +diff --git a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp +index 3d2991c..3df386d 100644 +--- a/gmic-qt/src/FilterSelector/FiltersPresenter.cpp ++++ b/gmic-qt/src/FilterSelector/FiltersPresenter.cpp +@@ -431,7 +431,7 @@ void FiltersPresenter::expandFaveFolder() + void FiltersPresenter::expandPreviousSessionExpandedFolders() + { + if (_filtersView) { +- QList expandedFolderPaths = QSettings().value("Config/ExpandedFolders", QStringList()).toStringList(); ++ QList expandedFolderPaths = GMIC_SETTINGS_INLINE.value("Config/ExpandedFolders", QStringList()).toStringList(); + _filtersView->expandFolders(expandedFolderPaths); + } + } +diff --git a/gmic-qt/src/Globals.h b/gmic-qt/src/Globals.h +index b19a38d..9ab3e3b 100644 +--- a/gmic-qt/src/Globals.h ++++ b/gmic-qt/src/Globals.h +@@ -59,7 +59,13 @@ const char WarningPrefix = '!'; + #define ONE_WEEK_HOURS (7 * 24) + #define TWO_WEEKS_HOURS (14 * 24) + #define ONE_MONTH_HOURS (30 * 24) ++#ifdef _GMIC_QT_CONSENT_TO_UPDATE_FIRST_ ++#define INTERNET_DEFAULT_PERIODICITY INTERNET_NEVER_UPDATE_PERIODICITY ++#define INTERNET_DEFAULT_REFRESH_UPDATE 0 ++#else + #define INTERNET_DEFAULT_PERIODICITY ONE_MONTH_HOURS ++#define INTERNET_DEFAULT_REFRESH_UPDATE 1 ++#endif + + #define PREVIEW_MAX_ZOOM_FACTOR 40.0 + +@@ -68,4 +74,17 @@ const char WarningPrefix = '!'; + #define KEYPOINTS_INTERACTIVE_MIDDLE_DELAY_MS ((KEYPOINTS_INTERACTIVE_LOWER_DELAY_MS + KEYPOINTS_INTERACTIVE_UPPER_DELAY_MS) / 2) + #define KEYPOINTS_INTERACTIVE_AVERAGING_COUNT 6 + ++#ifdef _GMIC_USE_HOSTED_SETTINGS_ ++#ifdef Q_OS_MACOS ++#define GMIC_SETTINGS(x) QSettings x(GMIC_QT_ORGANISATION_DOMAIN, GMIC_QT_APPLICATION_NAME) ++#define GMIC_SETTINGS_INLINE QSettings(GMIC_QT_ORGANISATION_DOMAIN, GMIC_QT_APPLICATION_NAME) ++#else ++#define GMIC_SETTINGS(x) QSettings x(GMIC_QT_ORGANISATION_NAME, GMIC_QT_APPLICATION_NAME) ++#define GMIC_SETTINGS_INLINE QSettings(GMIC_QT_ORGANISATION_NAME, GMIC_QT_APPLICATION_NAME) ++#endif ++#else ++#define GMIC_SETTINGS(x) QSettings x ++#define GMIC_SETTINGS_INLINE QSettings() ++#endif ++ + #endif // GMIC_QT_GLOBALS_H +diff --git a/gmic-qt/src/GmicProcessor.cpp b/gmic-qt/src/GmicProcessor.cpp +index 80c93c1..0019a1f 100644 +--- a/gmic-qt/src/GmicProcessor.cpp ++++ b/gmic-qt/src/GmicProcessor.cpp +@@ -209,6 +209,11 @@ bool GmicProcessor::isIdle() const + return !_filterThread; + } + ++bool GmicProcessor::isInputImagesEmpty() const ++{ ++ return _gmicImages->is_empty(); ++} ++ + int GmicProcessor::duration() const + { + if (_filterThread) { +diff --git a/gmic-qt/src/GmicProcessor.h b/gmic-qt/src/GmicProcessor.h +index cecdd1a..e85cb57 100644 +--- a/gmic-qt/src/GmicProcessor.h ++++ b/gmic-qt/src/GmicProcessor.h +@@ -94,6 +94,7 @@ public: + bool isProcessingFullImage() const; + bool isProcessing() const; + bool isIdle() const; ++ bool isInputImagesEmpty() const; + bool hasUnfinishedAbortedThreads() const; + + const gmic_library::gmic_image & previewImage() const; +diff --git a/gmic-qt/src/GmicQt.cpp b/gmic-qt/src/GmicQt.cpp +index 3af90b3..17b98c3 100644 +--- a/gmic-qt/src/GmicQt.cpp ++++ b/gmic-qt/src/GmicQt.cpp +@@ -87,7 +87,7 @@ RunParameters lastAppliedFilterRunParameters(ReturnedRunParametersFlag flag) + { + configureApplication(); + RunParameters parameters; +- QSettings settings; ++ GMIC_SETTINGS(settings); + const QString path = settings.value(QString("LastExecution/host_%1/FilterPath").arg(GmicQtHost::ApplicationShortname)).toString(); + parameters.filterPath = path.toStdString(); + QString args = settings.value(QString("LastExecution/host_%1/Arguments").arg(GmicQtHost::ApplicationShortname)).toString(); +@@ -197,7 +197,7 @@ int run(UserInterfaceMode interfaceMode, // + LanguageSettings::installTranslators(); + MainWindow mainWindow; + mainWindow.setPluginParameters(parameters); +- if (QSettings().value("Config/MainWindowMaximized", false).toBool()) { ++ if (GMIC_SETTINGS_INLINE.value("Config/MainWindowMaximized", false).toBool()) { + mainWindow.showMaximized(); + } else { + mainWindow.show(); +@@ -545,9 +545,11 @@ namespace + + void configureApplication() + { ++#ifndef _GMIC_USE_HOSTED_SETTINGS_ + QCoreApplication::setOrganizationName(GMIC_QT_ORGANISATION_NAME); + QCoreApplication::setOrganizationDomain(GMIC_QT_ORGANISATION_DOMAIN); + QCoreApplication::setApplicationName(GMIC_QT_APPLICATION_NAME); ++#endif + QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar); + #if !QT_VERSION_GTE(6, 0, 0) + if (QSettings().value(HIGHDPI_KEY, false).toBool()) { +diff --git a/gmic-qt/src/HeadlessProcessor.cpp b/gmic-qt/src/HeadlessProcessor.cpp +index f10efc3..a595ec1 100644 +--- a/gmic-qt/src/HeadlessProcessor.cpp ++++ b/gmic-qt/src/HeadlessProcessor.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include "Globals.h" + #include "Common.h" + #include "FilterParameters/FilterParametersWidget.h" + #include "FilterSelector/FiltersPresenter.h" +@@ -234,7 +235,7 @@ void HeadlessProcessor::onProcessingFinished() + GmicQtHost::outputImages(images, _filterThread->imageNames(), _outputMode); + _processingCompletedProperly = true; + } +- QSettings settings; ++ GMIC_SETTINGS(settings); + if (!status.isEmpty() && !_hash.isEmpty()) { + ParametersCache::setValues(_hash, status); + ParametersCache::save(); +@@ -267,7 +268,9 @@ void HeadlessProcessor::endApplication(const QString & errorMessage) + if (!errorMessage.isEmpty()) { + Logger::error(errorMessage); + } ++#ifndef _GMIC_USE_HOSTED_SETTINGS_ + QCoreApplication::exit(!errorMessage.isEmpty()); ++#endif + } + + } // namespace GmicQt +diff --git a/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp +new file mode 100644 +index 0000000..849ca44 +--- /dev/null ++++ b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.cpp +@@ -0,0 +1,233 @@ ++/* ++ * This file is part of G'MIC-Qt, a generic plug-in for raster graphics ++ * editors, offering hundreds of filters thanks to the underlying G'MIC ++ * image processing framework. ++ * ++ * Copyright (C) 2020-2022 L. E. Segovia ++ * ++ * Description: Krita painting suite plugin for G'Mic-Qt. ++ * ++ * G'MIC-Qt is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * G'MIC-Qt is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef Q_OS_ANDROID ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++#include "Settings.h" ++#include "GmicQt.h" ++#include "Globals.h" ++#include "HeadlessProcessor.h" ++#include "Host/GmicQtHost.h" ++#include "LanguageSettings.h" ++#include "Logger.h" ++#include "MainWindow.h" ++#include "Widgets/InOutPanel.h" ++#include "Widgets/ProgressInfoWindow.h" ++#include "Utils.h" ++#include "gmicqttoolplugin.h" ++ ++#include "kpluginfactory.h" ++ ++K_PLUGIN_FACTORY_WITH_JSON(KritaGmicPluginFactory, ++ "gmicqttoolplugin.json", ++ registerPlugin();) ++ ++KritaGmicPlugin::KritaGmicPlugin(QObject *parent, const QVariantList &) ++ : QObject(parent) ++{ ++#ifdef Q_OS_WIN ++ // Workaround for deploying basic CLUTs ++ // See https://krita-artists.org/t/unknown-filename-gmic-qt/37813 ++ { ++ const auto srcPath = QDir(QCoreApplication::applicationDirPath().append(QStringLiteral("/../share/gmic/"))).absolutePath(); ++ const auto dstPath = GmicQt::gmicConfigPath(true); ++ const std::list files = {"/gmic_cluts.gmz", "/gmic_denoise_cnn.gmz"}; ++ ++ for (const auto file: files) { ++ const auto src = srcPath + file; ++ const auto dst = dstPath + file; ++ if (QFileInfo(src).exists() && !QFileInfo(dst).exists()) { ++ qWarning() << src << dst; ++ QFile::copy(src, dst); ++ } ++ } ++ ++ if (!qEnvironmentVariableIsSet("GMIC_SYSTEM_PATH")) { ++ qputenv("GMIC_SYSTEM_PATH", QString(srcPath).replace(L'/', L'\\').toLocal8Bit()); ++ } ++ } ++#endif ++} ++ ++int KritaGmicPlugin::launch(std::shared_ptr i, bool headless) ++{ ++#ifdef Q_OS_ANDROID ++ /* Since on Android stdout and stderr redirect to null, un-redirect them */ ++ /* based on https://stackoverflow.com/a/gmic-qt/31777050 */ ++ ++ std::array oldFd; ++ std::array newStdout, newStderr; ++ ++ auto redir_worker = [](std::array &fd, android_LogPriority lvl) { ++ ssize_t rdsz; ++ std::array buf{}; ++ while ((rdsz = read(fd[0], buf.data(), buf.size() - 1)) > 0) { ++ if (buf[rdsz - 1] == '\n') ++ --rdsz; ++ buf[rdsz] = 0; /* add null-terminator */ ++ __android_log_write( ++ lvl, qPrintable(GmicQtHost::ApplicationName), buf.data()); ++ } ++ }; ++ ++ /* make stdout line-buffered and stderr unbuffered */ ++ setvbuf(stdout, 0, _IOLBF, 0); ++ setvbuf(stderr, 0, _IOLBF, 0); ++ ++ /* create the pipe and redirect stdout and stderr */ ++ dup2(1, oldFd[0]); ++ dup2(2, oldFd[1]); ++ pipe(newStdout.data()); ++ pipe(newStderr.data()); ++ dup2(newStdout[1], 1); ++ dup2(newStderr[1], 2); ++ ++ /* spawn the logging thread */ ++ auto newStdoutRedir = ++ std::thread(redir_worker, std::ref(newStdout), ANDROID_LOG_DEBUG); ++ auto newStderrRedir = ++ std::thread(redir_worker, std::ref(newStderr), ANDROID_LOG_WARN); ++ newStdoutRedir.detach(); ++ newStderrRedir.detach(); ++#endif ++ ++ using namespace GmicQt; ++ ++ std::list disabledInputModes; ++ disabledInputModes.push_back(GmicQt::InputMode::NoInput); ++ // disabledInputModes.push_back(GmicQt::Active); ++ // disabledInputModes.push_back(GmicQt::All); ++ // disabledInputModes.push_back(GmicQt::ActiveAndBelow); ++ // disabledInputModes.push_back(GmicQt::ActiveAndAbove); ++ disabledInputModes.push_back(GmicQt::InputMode::AllVisible); ++ disabledInputModes.push_back(GmicQt::InputMode::AllInvisible); ++ ++ std::list disabledOutputModes; ++ // disabledOutputModes.push_back(GmicQt::OutputMode::InPlace); ++ disabledOutputModes.push_back(GmicQt::OutputMode::NewImage); ++ disabledOutputModes.push_back(GmicQt::OutputMode::NewLayers); ++ disabledOutputModes.push_back(GmicQt::OutputMode::NewActiveLayers); ++ ++ int status = 0; ++ GmicQtHost::iface = i; ++ if (headless) { ++ GmicQt::RunParameters parameters = GmicQt::lastAppliedFilterRunParameters( ++ GmicQt::ReturnedRunParametersFlag::AfterFilterExecution); ++ { ++ for (const GmicQt::InputMode & mode : disabledInputModes) { ++ GmicQt::InOutPanel::disableInputMode(mode); ++ } ++ for (const GmicQt::OutputMode & mode : disabledOutputModes) { ++ GmicQt::InOutPanel::disableOutputMode(mode); ++ } ++ } ++ Settings::load(GmicQt::UserInterfaceMode::ProgressDialog); ++ Logger::setMode(Settings::outputMessageMode()); ++ LanguageSettings::installTranslators(); ++ ++ HeadlessProcessor processor(nullptr); ++ if (!processor.setPluginParameters(parameters)) { ++ Logger::error(processor.error()); ++ return 1; ++ } ++ ++ QPointer progressWindow(new ProgressInfoWindow(&processor)); ++ // We want a non modal dialog here. ++ progressWindow->setWindowFlags(Qt::Tool | Qt::Dialog); ++ progressWindow->setWindowModality(Qt::ApplicationModal); ++ // Make it destroy itself on close (signaling the event loop) ++ progressWindow->setAttribute(Qt::WA_DeleteOnClose); ++ ++ processor.startProcessing(); ++ ++ QEventLoop loop; ++ connect(progressWindow, SIGNAL(destroyed()), &loop, SLOT(quit())); ++ status = loop.exec(); ++ } else { ++ GmicQt::RunParameters parameters = GmicQt::lastAppliedFilterRunParameters( ++ GmicQt::ReturnedRunParametersFlag::AfterFilterExecution); ++ { ++ for (const GmicQt::InputMode & mode : disabledInputModes) { ++ GmicQt::InOutPanel::disableInputMode(mode); ++ } ++ for (const GmicQt::OutputMode & mode : disabledOutputModes) { ++ GmicQt::InOutPanel::disableOutputMode(mode); ++ } ++ } ++ Settings::load(GmicQt::UserInterfaceMode::Full); ++ Logger::setMode(Settings::outputMessageMode()); ++ LanguageSettings::installTranslators(); ++ ++ QPointer mainWindow(new MainWindow(qApp->activeWindow())); ++ mainWindow->setPluginParameters(parameters); ++#ifdef Q_OS_MACOS ++ mainWindow->setWindowFlags(Qt::Tool | Qt::Dialog); ++#else ++ mainWindow->setWindowFlags(Qt::Dialog); ++#endif ++ mainWindow->setWindowModality(Qt::ApplicationModal); ++ // Make it destroy itself on close (signaling the event loop) ++ mainWindow->setAttribute(Qt::WA_DeleteOnClose); ++ ++ if (GMIC_SETTINGS_INLINE.value("Config/MainWindowMaximized", false).toBool()) { ++ mainWindow->showMaximized(); ++ } else { ++ mainWindow->show(); ++ } ++ ++ // Wait than main widget is closed. ++ QEventLoop loop; ++ connect(mainWindow, SIGNAL(destroyed()), &loop, SLOT(quit())); ++ status = loop.exec(); ++ } ++ ++ GmicQtHost::sharedMemorySegments.clear(); ++ GmicQtHost::iface.reset(); ++ ++#ifdef Q_OS_ANDROID ++ /* un-redirect stdout and stderr */ ++ dup2(oldFd[0], 1); ++ dup2(oldFd[1], 2); ++#endif ++ ++ return status; ++} ++ ++#include "gmicqttoolplugin.moc" +diff --git a/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.h b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.h +new file mode 100644 +index 0000000..bea9056 +--- /dev/null ++++ b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.h +@@ -0,0 +1,55 @@ ++/* ++ * This file is part of G'MIC-Qt, a generic plug-in for raster graphics ++ * editors, offering hundreds of filters thanks to the underlying G'MIC ++ * image processing framework. ++ * ++ * Copyright (C) 2020-2021 L. E. Segovia ++ * ++ * Description: Krita painting suite plugin for G'Mic-Qt. ++ * ++ * G'MIC-Qt is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * G'MIC-Qt is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ * ++ */ ++ ++#ifndef GMICQT_TOOL_PLUGIN_H ++#define GMICQT_TOOL_PLUGIN_H ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++namespace GmicQtHost ++{ ++extern QVector sharedMemorySegments; ++extern std::shared_ptr iface; ++} // namespace GmicQtHost ++ ++class KritaGmicPlugin : public QObject, public KisQmicPluginInterface ++{ ++ Q_OBJECT ++ Q_INTERFACES(KisQmicPluginInterface) ++ ++public: ++ KritaGmicPlugin(QObject *parent, const QVariantList &); ++ ++ int launch(std::shared_ptr iface, ++ bool headless = false) override; ++}; ++ ++#endif +diff --git a/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.json b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.json +new file mode 100644 +index 0000000..4639d5e +--- /dev/null ++++ b/gmic-qt/src/Host/KritaPlugin/gmicqttoolplugin.json +@@ -0,0 +1,9 @@ ++{ ++ "Id": "GMic-Qt Krita Plugin", ++ "Type": "Service", ++ "X-KDE-Library": "gmic_krita_qt", ++ "X-KDE-ServiceTypes": [ ++ "Krita/GMic" ++ ], ++ "X-Krita-Version": "28" ++} +diff --git a/gmic-qt/src/Host/KritaPlugin/host.cpp b/gmic-qt/src/Host/KritaPlugin/host.cpp +new file mode 100644 +index 0000000..fcfa12b +--- /dev/null ++++ b/gmic-qt/src/Host/KritaPlugin/host.cpp +@@ -0,0 +1,195 @@ ++/* ++ * Copyright (C) 2017 Boudewijn Rempt ++ * Copyright (C) 2020-2022 L. E. Segovia ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "GmicQt.h" ++#include "Host/GmicQtHost.h" ++#ifndef gmic_core ++#include "CImg.h" ++#endif ++#include "gmic.h" ++#include "kis_qmic_interface.h" ++ ++/* ++ * No messages are sent in the plugin version of GMic. ++ * Instead, a list of KisQMicImageSP (shared pointers to KisQMic instances) ++ * are sent. These have: ++ * ++ * layer name ++ * shared pointer to data ++ * width ++ * height ++ * a mutex to control access. ++ * ++ * For the sake of debuggability, the overall control flow has been maintained. ++ */ ++ ++namespace GmicQtHost ++{ ++const QString ApplicationName = QStringLiteral("Krita"); ++const char *const ApplicationShortname = GMIC_QT_XSTRINGIFY(GMIC_HOST); ++const bool DarkThemeIsDefault = false; ++ ++QVector sharedMemorySegments; ++std::shared_ptr iface; ++ ++void getLayersExtent(int *width, int *height, GmicQt::InputMode mode) ++{ ++#if defined(KRITA_QMIC_INTERFACE_VERSION) && KRITA_QMIC_INTERFACE_VERSION >= 0x05010001 ++ const auto size = iface->gmic_qt_get_image_size(static_cast(mode)); ++#else ++ const auto size = iface->gmic_qt_get_image_size(); ++#endif ++ *width = size.width(); ++ *height = size.height(); ++ ++ // qDebug() << "gmic-qt: layers extent:" << *width << *height; ++} ++ ++void getCroppedImages(gmic_list &images, ++ gmic_list &imageNames, ++ double x, ++ double y, ++ double width, ++ double height, ++ GmicQt::InputMode mode) ++{ ++ // qDebug() << "gmic-qt: get_cropped_images:" << x << y << width << height; ++ ++ const bool entireImage = x < 0 && y < 0 && width < 0 && height < 0; ++ if (entireImage) { ++ x = 0.0; ++ y = 0.0; ++ width = 1.0; ++ height = 1.0; ++ } ++ ++ // Create a message for Krita ++ QRectF cropRect = {x, y, width, height}; ++ auto imagesList = ++ iface->gmic_qt_get_cropped_images(static_cast(mode), cropRect); ++ ++ if (imagesList.isEmpty()) { ++ qWarning() << "\tgmic-qt: empty answer!"; ++ return; ++ } ++ ++ // qDebug() << "\tgmic-qt: " << answer; ++ ++ images.assign(imagesList.size()); ++ imageNames.assign(imagesList.size()); ++ ++ // qDebug() << "\tgmic-qt: imagelist size" << imagesList.size(); ++ ++ // Get the layers as prepared by Krita in G'Mic format ++ for (int i = 0; i < imagesList.length(); ++i) { ++ const auto &layer = imagesList[i]; ++ const auto ba = layer->m_layerName.toUtf8(); ++ gmic_image::string(ba.data()).move_to(imageNames[i]); ++ ++ // Fill images from the shared memory areas ++ ++ { ++ QMutexLocker lock(&layer->m_mutex); ++ ++ // qDebug() << "Memory segment" << (quintptr)image.data() << image->size() ++ // << (quintptr)&image->m_data << (quintptr)image->m_data.get(); ++ ++ // convert the data to the list of float ++ gmic_image gimg; ++ gimg.assign(layer->m_width, layer->m_height, 1, 4); ++ const size_t length = ++ layer->m_width * layer->m_height * 4U * sizeof(float); ++ std::memcpy(gimg._data, layer->constData(), length); ++ gimg.move_to(images[i]); ++ } ++ } ++ ++ iface->gmic_qt_detach(); ++ ++ // qDebug() << "\tgmic-qt: Images size" << images.size() << ", names size" << ++ // imageNames.size(); ++} ++ ++void outputImages(gmic_list &images, ++ const gmic_list &imageNames, ++ GmicQt::OutputMode mode) ++{ ++ // qDebug() << "qmic-qt-output-images"; ++ ++ sharedMemorySegments.clear(); ++ ++ // qDebug() << "\tqmic-qt: shared memory" << sharedMemorySegments.count(); ++ ++ // Create qsharedmemory segments for each image ++ // Create a message for Krita based on mode, the keys of the qsharedmemory ++ // segments and the imageNames ++ QVector layers; ++ ++ for (uint i = 0; i < images.size(); ++i) { ++ // qDebug() << "\tgmic-qt: image number" << i; ++ ++ gmic_image gimg = images.at(i); ++ ++ const auto layerName = QString::fromUtf8(imageNames[i].data()); ++ ++ KisQMicImageSP m = KisQMicImageSP::create( ++ layerName, gimg._width, gimg._height, gimg._spectrum); ++ sharedMemorySegments << m; ++ ++ { ++ QMutexLocker lock(&m->m_mutex); ++ ++ const auto slice = gimg.get_slice(0); ++ ++ const auto length = slice._width * slice._height * slice._spectrum * sizeof(float); ++ std::memcpy(m->m_data, slice._data, length); ++ } ++ ++ layers << m; ++ } ++ ++ iface->gmic_qt_output_images(static_cast(mode), layers); ++} ++ ++void showMessage(const char *) ++{ ++ // May be left empty for Krita. ++ // Only used by launchPluginHeadless(), called in the non-interactive ++ // script mode of GIMP. ++} ++ ++void applyColorProfile(cimg_library::CImg &) ++{ ++} ++ ++} // namespace GmicQtHost +diff --git a/gmic-qt/src/Host/None/JpegQualityDialog.cpp b/gmic-qt/src/Host/None/JpegQualityDialog.cpp +index 69635c6..00a7f95 100644 +--- a/gmic-qt/src/Host/None/JpegQualityDialog.cpp ++++ b/gmic-qt/src/Host/None/JpegQualityDialog.cpp +@@ -2,6 +2,8 @@ + #include + #include "Settings.h" + #include "ui_jpegqualitydialog.h" ++#include "Globals.h" ++ + int JpegQualityDialog::_permanentQuality = -1; + int JpegQualityDialog::_selectedQuality = -1; + +@@ -15,7 +17,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new + ui->spinBox->setRange(0, 100); + + if (_selectedQuality == -1) { +- _selectedQuality = QSettings().value(JPEG_QUALITY_KEY, 85).toInt(); ++ _selectedQuality = GMIC_SETTINGS_INLINE.value(JPEG_QUALITY_KEY, 85).toInt(); + } + + ui->slider->setValue(_selectedQuality); +@@ -25,7 +27,7 @@ JpegQualityDialog::JpegQualityDialog(QWidget * parent) : QDialog(parent), ui(new + connect(ui->spinBox, QOverload::of(&QSpinBox::valueChanged), ui->slider, &QSlider::setValue); + connect(ui->pbOk, &QPushButton::clicked, [this]() { + _selectedQuality = ui->spinBox->value(); +- QSettings().setValue(JPEG_QUALITY_KEY, _selectedQuality); ++ GMIC_SETTINGS_INLINE.setValue(JPEG_QUALITY_KEY, _selectedQuality); + }); + connect(ui->pbOk, &QPushButton::clicked, this, &QDialog::accept); + connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject); +diff --git a/gmic-qt/src/LanguageSettings.cpp b/gmic-qt/src/LanguageSettings.cpp +index 7e74667..0c92a47 100644 +--- a/gmic-qt/src/LanguageSettings.cpp ++++ b/gmic-qt/src/LanguageSettings.cpp +@@ -23,6 +23,7 @@ + * + */ + ++#include "Globals.h" + #include "LanguageSettings.h" + #include + #include +@@ -66,7 +67,11 @@ const QMap & LanguageSettings::availableLanguages() + + QString LanguageSettings::configuredTranslator() + { +- QString code = QSettings().value(LANGUAGE_CODE_KEY, QString()).toString(); ++#ifndef _GMIC_QT_DISABLE_TRANSLATION_ ++ QString code = GMIC_SETTINGS_INLINE.value(LANGUAGE_CODE_KEY, QString()).toString(); ++#else ++ QString code; ++#endif + if (code.isEmpty()) { + code = systemDefaultAndAvailableLanguageCode(); + if (code.isEmpty()) { +@@ -105,7 +110,7 @@ void LanguageSettings::installTranslators() + if (!lang.isEmpty() && (lang != "en")) { + installQtTranslator(lang); + installTranslator(QString(":/translations/%1.qm").arg(lang)); +- if (QSettings().value(ENABLE_FILTER_TRANSLATION, false).toBool()) { ++ if (GMIC_SETTINGS_INLINE.value(ENABLE_FILTER_TRANSLATION, false).toBool()) { + installTranslator(QString(":/translations/filters/%1.qm").arg(lang)); + } + } +diff --git a/gmic-qt/src/MainWindow.cpp b/gmic-qt/src/MainWindow.cpp +index d48e095..008d955 100644 +--- a/gmic-qt/src/MainWindow.cpp ++++ b/gmic-qt/src/MainWindow.cpp +@@ -187,8 +187,12 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent), ui(new Ui::MainW + updateShortcutF5->setContext(Qt::ApplicationShortcut); + QShortcut * updateShortcutCtrlR = new QShortcut(QKeySequence("Ctrl+R"), this); + updateShortcutCtrlR->setContext(Qt::ApplicationShortcut); ++#ifdef _GMIC_QT_DISABLE_UPDATES_ ++ ui->tbUpdateFilters->setEnabled(false); ++#else + connect(updateShortcutF5, &QShortcut::activated, [this]() { ui->tbUpdateFilters->animateClick(); }); + connect(updateShortcutCtrlR, &QShortcut::activated, [this]() { ui->tbUpdateFilters->animateClick(); }); ++#endif + ui->tbUpdateFilters->setToolTip(updateText); + } + +@@ -275,6 +279,7 @@ void MainWindow::setIcons() + ui->tbExpandCollapse->setIcon(_expandIcon); + } + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void MainWindow::setDarkTheme() + { + // SHOW(QStyleFactory::keys()); +@@ -328,6 +333,7 @@ void MainWindow::setDarkTheme() + ui->vSplitterLine->setStyleSheet("QFrame{ border-top: 0px none #a0a0a0; border-bottom: 1px solid rgb(160,160,160);}"); + Settings::UnselectedFilterTextColor = Settings::UnselectedFilterTextColor.darker(150); + } ++#endif + + void MainWindow::setPluginParameters(const RunParameters & parameters) + { +@@ -363,7 +369,9 @@ void MainWindow::onUpdateDownloadsFinished(int status) + showMessage(tr("No download was needed."), 3000); + } + ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + ui->tbUpdateFilters->setEnabled(true); ++#endif + if (_filtersPresenter->currentFilter().hash.isEmpty()) { + setNoFilter(); + } else { +@@ -385,7 +393,7 @@ void MainWindow::buildFiltersTree() + _filtersPresenter->importGmicGTKFaves(); + _filtersPresenter->saveFaves(); + _gtkFavesShouldBeImported = false; +- QSettings().setValue(FAVES_IMPORT_KEY, true); ++ GMIC_SETTINGS_INLINE.setValue(FAVES_IMPORT_KEY, true); + } + _filtersPresenter->toggleSelectionMode(withVisibility); + } +@@ -493,7 +501,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status) + } else if (status == (int)Updater::UpdateStatus::NotNecessary) { + } + +- if (QSettings().value(FAVES_IMPORT_KEY, false).toBool() || !FavesModelReader::gmicGTKFaveFileAvailable()) { ++ if (GMIC_SETTINGS_INLINE.value(FAVES_IMPORT_KEY, false).toBool() || !FavesModelReader::gmicGTKFaveFileAvailable()) { + _gtkFavesShouldBeImported = false; + } else { + _gtkFavesShouldBeImported = askUserForGTKFavesImport(); +@@ -511,7 +519,7 @@ void MainWindow::onStartupFiltersUpdateFinished(int status) + } + + // Retrieve and select previously selected filter +- QString hash = QSettings().value("SelectedFilter", QString()).toString(); ++ QString hash = GMIC_SETTINGS_INLINE.value("SelectedFilter", QString()).toString(); + if (_newSession || !_lastExecutionOK) { + hash.clear(); + } +@@ -576,7 +584,9 @@ void MainWindow::onEscapeKeyPressed() + } else { + _processor.cancel(); + ui->previewWidget->displayOriginalImage(); ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + ui->tbUpdateFilters->setEnabled(true); ++#endif + } + } + } +@@ -696,7 +706,9 @@ void MainWindow::onPreviewUpdateRequested(bool synchronous, bool randomized) + ui->previewWidget->invalidateSavedPreview(); + return; + } ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + ui->tbUpdateFilters->setEnabled(false); ++#endif + _processor.init(); + GmicProcessor::FilterContext context; + if (!ui->cbPreview->isChecked()) { +@@ -764,7 +776,9 @@ void MainWindow::onPreviewImageAvailable() + } + ui->previewWidget->setPreviewImage(_processor.previewImage()); + ui->previewWidget->enableRightClick(); ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + ui->tbUpdateFilters->setEnabled(true); ++#endif + } + + void MainWindow::onGUIDynamismRunDone() +@@ -779,9 +793,19 @@ void MainWindow::onGUIDynamismRunDone() + + void MainWindow::onPreviewError(const QString & message) + { ++ // if Krita is too busy generating the images, restart the ++ // the preview process ++ if (_processor.isInputImagesEmpty()) { ++ CroppedImageListProxy::clear(); ++ QTimer::singleShot(1000, ui->previewWidget, SLOT(sendUpdateRequest())); ++ return; ++ } ++ + ui->previewWidget->setPreviewErrorMessage(message); + ui->previewWidget->enableRightClick(); ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + ui->tbUpdateFilters->setEnabled(true); ++#endif + } + + void MainWindow::onParametersChanged() +@@ -864,12 +888,16 @@ void MainWindow::onVeryFirstShowEvent() + Updater::setOutputMessageMode(Settings::outputMessageMode()); + int ageLimit; + { +- QSettings settings; ++ GMIC_SETTINGS(settings); + ageLimit = settings.value(INTERNET_UPDATE_PERIODICITY_KEY, INTERNET_DEFAULT_PERIODICITY).toInt(); + } ++#ifndef _GMIC_QT_DISABLE_UPDATES_ + const bool useNetwork = (ageLimit != INTERNET_NEVER_UPDATE_PERIODICITY); ++#else ++ const bool useNetwork = false; ++#endif + ui->progressInfoWidget->startFiltersUpdateAnimationAndShow(); +- Updater::getInstance()->startUpdate(ageLimit, 4, useNetwork); ++ Updater::getInstance()->startUpdate(ageLimit, 60, useNetwork); + } + + void MainWindow::setZoomConstraint() +@@ -1019,7 +1047,7 @@ void MainWindow::saveCurrentParameters() + + void MainWindow::saveSettings() + { +- QSettings settings; ++ GMIC_SETTINGS(settings); + + _filtersPresenter->saveSettings(settings); + +@@ -1061,7 +1089,7 @@ void MainWindow::saveSettings() + + void MainWindow::loadSettings() + { +- QSettings settings; ++ GMIC_SETTINGS(settings); + _filtersPresenter->loadSettings(settings); + _lastExecutionOK = settings.value("LastExecution/ExitedNormally", true).toBool(); + _newSession = host_app_pid() != settings.value("LastExecution/HostApplicationID", 0).toUInt(); +@@ -1076,9 +1104,11 @@ void MainWindow::loadSettings() + if (settings.value("Config/PreviewPosition", "Left").toString() == "Left") { + setPreviewPosition(PreviewPosition::Left); + } ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + setDarkTheme(); + } ++#endif + if (!Settings::visibleLogos()) { + ui->logosLabel->hide(); + } +@@ -1122,7 +1152,7 @@ void MainWindow::loadSettings() + ui->splitter->setSizes(sizes); + } + +- ui->cbInternetUpdate->setChecked(settings.value("Config/RefreshInternetUpdate", true).toBool()); ++ ui->cbInternetUpdate->setChecked(settings.value(REFRESH_USING_INTERNET_KEY, INTERNET_DEFAULT_REFRESH_UPDATE).toBool()); + } + + void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position) +@@ -1184,7 +1214,7 @@ void MainWindow::setPreviewPosition(MainWindow::PreviewPosition position) + void MainWindow::adjustVerticalSplitter() + { + QList sizes; +- QSettings settings; ++ GMIC_SETTINGS(settings); + sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeTop"), -1).toInt()); + sizes.push_back(settings.value(QString("Config/ParamsVerticalSplitterSizeBottom"), -1).toInt()); + const int splitterHeight = ui->verticalSplitter->height(); +@@ -1315,17 +1345,19 @@ bool MainWindow::askUserForGTKFavesImport() + QMessageBox::Yes | QMessageBox::No, this); + messageBox.setDefaultButton(QMessageBox::Yes); + QCheckBox * cb = new QCheckBox(tr("Don't ask again")); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + QPalette p = cb->palette(); + p.setColor(QPalette::Text, Settings::CheckBoxTextColor); + p.setColor(QPalette::Base, Settings::CheckBoxBaseColor); + cb->setPalette(p); + } ++#endif + messageBox.setCheckBox(cb); + int choice = messageBox.exec(); + if (choice != QMessageBox::Yes) { + if (cb->isChecked()) { +- QSettings().setValue(FAVES_IMPORT_KEY, true); ++ GMIC_SETTINGS_INLINE.setValue(FAVES_IMPORT_KEY, true); + } + return false; + } +diff --git a/gmic-qt/src/MainWindow.h b/gmic-qt/src/MainWindow.h +index e7ed69d..ea16e23 100644 +--- a/gmic-qt/src/MainWindow.h ++++ b/gmic-qt/src/MainWindow.h +@@ -70,7 +70,9 @@ public: + explicit MainWindow(QWidget * parent = nullptr); + ~MainWindow() override; + void updateFiltersFromSources(int ageLimit, bool useNetwork); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void setDarkTheme(); ++#endif + void setPluginParameters(const RunParameters & parameters); + + public slots: +diff --git a/gmic-qt/src/Settings.cpp b/gmic-qt/src/Settings.cpp +index 4764218..6e91e78 100644 +--- a/gmic-qt/src/Settings.cpp ++++ b/gmic-qt/src/Settings.cpp +@@ -77,7 +77,7 @@ QString Settings::NegativeSign('-'); + + void Settings::load(UserInterfaceMode userInterfaceMode) + { +- QSettings settings; ++ GMIC_SETTINGS(settings); + _visibleLogos = settings.value("LogosAreVisible", true).toBool(); + _darkThemeEnabled = settings.value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool(); + _languageCode = settings.value(LANGUAGE_CODE_KEY, QString()).toString(); +@@ -131,7 +131,11 @@ void Settings::setVisibleLogos(bool on) + + bool Settings::darkThemeEnabled() + { +- return _darkThemeEnabled; ++#ifdef _GMIC_QT_DISABLE_THEMING_ ++ return GmicQtHost::DarkThemeIsDefault; ++#else ++ return _darkThemeEnabled; ++#endif + } + + void Settings::setDarkThemeEnabled(bool on) +@@ -273,8 +277,10 @@ void Settings::save(QSettings & settings) + { + removeObsoleteKeys(settings); + settings.setValue("LogosAreVisible", _visibleLogos); ++#ifndef _GMIC_QT_DISABLE_TRANSLATION_ + settings.setValue(LANGUAGE_CODE_KEY, _languageCode); + settings.setValue(ENABLE_FILTER_TRANSLATION, _filterTranslationEnabled); ++#endif + settings.setValue("Config/PreviewPosition", (_previewPosition == MainWindow::PreviewPosition::Left) ? "Left" : "Right"); + + settings.setValue("Config/NativeColorDialogs", _nativeColorDialogs); +diff --git a/gmic-qt/src/Tags.cpp b/gmic-qt/src/Tags.cpp +index fae4d99..d3140e0 100644 +--- a/gmic-qt/src/Tags.cpp ++++ b/gmic-qt/src/Tags.cpp +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -148,7 +149,10 @@ QAction * TagAssets::action(QObject * parent, TagColor color, IconMark mark) + if ((color == TagColor::None) || (color == TagColor::Count)) { + return nullptr; + } +- return new QAction(menuIcon(color, mark), QObject::tr("%1 Tag").arg(colorName(color)), parent); ++ QAction *action = new QAction(menuIcon(color, mark), QObject::tr("%1 Tag").arg(colorName(color)), parent); ++ if (qApp->testAttribute(Qt::AA_DontShowIconsInMenus)) ++ action->setIconVisibleInMenu(true); ++ return action; + } + + QString TagAssets::colorName(TagColor color) +diff --git a/gmic-qt/src/Widgets/InOutPanel.cpp b/gmic-qt/src/Widgets/InOutPanel.cpp +index 2a30f99..535ba84 100644 +--- a/gmic-qt/src/Widgets/InOutPanel.cpp ++++ b/gmic-qt/src/Widgets/InOutPanel.cpp +@@ -157,10 +157,12 @@ void InOutPanel::onResetButtonClicked() + setState(InputOutputState::Default, true); + } + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void InOutPanel::setDarkTheme() + { + ui->tbReset->setIcon(IconLoader::load("view-refresh")); + } ++#endif + + void InOutPanel::setDefaultInputMode() + { +diff --git a/gmic-qt/src/Widgets/InOutPanel.h b/gmic-qt/src/Widgets/InOutPanel.h +index 381bc64..7939d3a 100644 +--- a/gmic-qt/src/Widgets/InOutPanel.h ++++ b/gmic-qt/src/Widgets/InOutPanel.h +@@ -79,7 +79,9 @@ public slots: + void onInputModeSelected(int); + void onOutputModeSelected(int); + void onResetButtonClicked(); ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void setDarkTheme(); ++#endif + + private: + static void setDefaultInputMode(); +diff --git a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp +index 533d257..604cf47 100644 +--- a/gmic-qt/src/Widgets/ProgressInfoWindow.cpp ++++ b/gmic-qt/src/Widgets/ProgressInfoWindow.cpp +@@ -59,9 +59,11 @@ ProgressInfoWindow::ProgressInfoWindow(HeadlessProcessor * processor) : QMainWin + connect(processor, &HeadlessProcessor::done, this, &ProgressInfoWindow::onProcessingFinished); + _isShown = false; + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + if (Settings::darkThemeEnabled()) { + setDarkTheme(); + } ++#endif + } + + ProgressInfoWindow::~ProgressInfoWindow() +@@ -85,6 +87,7 @@ void ProgressInfoWindow::closeEvent(QCloseEvent * event) + event->accept(); + } + ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void ProgressInfoWindow::setDarkTheme() + { + qApp->setStyle(QStyleFactory::create("Fusion")); +@@ -107,6 +110,7 @@ void ProgressInfoWindow::setDarkTheme() + p.setColor(QPalette::Disabled, QPalette::WindowText, QColor(110, 110, 110)); + qApp->setPalette(p); + } ++#endif + + void ProgressInfoWindow::onCancelClicked(bool) + { +diff --git a/gmic-qt/src/Widgets/ProgressInfoWindow.h b/gmic-qt/src/Widgets/ProgressInfoWindow.h +index 615dd16..9db9a1a 100644 +--- a/gmic-qt/src/Widgets/ProgressInfoWindow.h ++++ b/gmic-qt/src/Widgets/ProgressInfoWindow.h +@@ -57,7 +57,9 @@ public: + protected: + void showEvent(QShowEvent *) override; + void closeEvent(QCloseEvent *) override; ++#ifndef _GMIC_QT_DISABLE_THEMING_ + void setDarkTheme(); ++#endif + + public slots: + void onCancelClicked(bool); +diff --git a/gmic-qt/ui/dialogsettings.ui b/gmic-qt/ui/dialogsettings.ui +index 10b7ec8..f03ef4c 100644 +--- a/gmic-qt/ui/dialogsettings.ui ++++ b/gmic-qt/ui/dialogsettings.ui +@@ -108,7 +108,7 @@ + + + +- ++ + + Theme + +-- +2.45.2 +