Commit graph

54642 commits

Author SHA1 Message Date
Alx Sa
4eb462a7a4 display: Fix copy/paste typo for UNSCALEY
In 9fe8e849, we accidentally used UNSCALEX
rather than UNSCALEY for offset_y. This patch
corrects that typo.
2025-05-15 13:06:36 +00:00
Alx Sa
6475f0a6dc widgets: Change multi-window title bar based on theme
Applies ad8b47bf to title bars of GimpDockWindows so that
they adapt to the Windows system theme colors.
2025-05-14 23:48:51 -04:00
Jehan
51d69fa44b plug-ins: do not warn for invalid font names at startup.
While all other resources are supposed to be already loaded, this is not
the case of fonts which are loaded in a thread, and whose loading may
end after plug-ins are initialized. So ignore unknown font name as an
exception (because we can't know if it is really unknown or just not
loaded yet).

This fixes such WARNINGs:

> (script-fu:33006): scriptfu-WARNING **: 14:35:28.259: script_fu_add_resource_arg declared resource name is invalid Serif
2025-05-15 02:16:10 +02:00
Jehan
02fd84394c app: fix build warnings.
This fixes 2 such warnings:

> app/text/gimpfontfactory.c: In function ‘gimp_font_factory_load_names’:
> /usr/include/glib-2.0/glib/gstring.h:74:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]

The (void) ! trick was also possible but this is so ugly so I went for
actual usage of the return value as we should.

Also clean up some trailing whitespaces.
2025-05-15 01:02:53 +02:00
Idriss Fekir
8328dfb25b GimpFontFactory: Move font loading to another thread
This is to make sure than regardless of how many fonts there are, font loading
won't delay startup.

FontConfig if compiled against libxml2 might fail to parse huge xml configs.
So instead of passing it a huge xml, pass the xml every MAX_NUM_FONTS_PER_CONFIG (currently 1000) fonts.

Also made GimpFontFactory custom config strings private because there is no reason for them to be public.
2025-05-14 22:42:22 +00:00
Idriss Fekir
f63e8afe60 GimpFontFactory:Speed up font loading
Profiling showed that a significant amount of time was spent created the hb_blob, and calling FcParseAndLoadFromMemory.

To allow only fonts that pango/harfbuzz recognize, an hb_blob was created from
every font to test if harfbuzz recognizes it, which is obviously a lot of overhead.
FontConfig allows to check if the Font is SNFT and wether it's a WOFF[2] font.
2025-05-14 22:42:22 +00:00
Jehan
2702a47c9e NEWS: update. 2025-05-14 22:53:51 +02:00
Bruno Lopes
84c4e0b639
gitlab-ci, devel-docs: Update to new "Package:" labels
A common prefix makes easier to use these dist pipelines.
2025-05-14 09:13:40 -03:00
Idriss Fekir
f0dc96caf1 GimpText:Partially Revert some of the changes in commit b2eb374aaacd0c8054234c4fa2b785da0007355f
I accidently commited 2 calls to g_assert in the previous commit.

Reverting.
2025-05-14 09:16:28 +02:00
Idriss Fekir
9d43b2cfc2 GimpText: Fix crash when serializing text with missing font.
For some reason pango returns a FontDescription with name "Normal" when called
with empty string. This caused crashes in pango markup serialization. This
patch checks if the font before serialization is a valid font object, otherwise fallback to the fallback font.

Also font's reference count wasn't increased in one case when opening xcf file with a text layer.
2025-05-14 01:51:58 +02:00
lloyd konneker
12806b2830 ScriptFu: tests: add tests of selection semantics
No changes except to tests.
2025-05-13 11:22:25 -04:00
Alx Sa
60891765a5 core: Update filter size when image is rotated
Resolves #13981
The dimensions of NDE filters were being updated
when a drawable was resized or scaled, but not when
the drawable was rotated. Since this transform also
affects the dimensions of the filter, the filter refresh
code should be called there as well.
2025-05-13 14:28:29 +00:00
Bruno Lopes
e68cc824c1
devel-docs: Restore one paragraph from icons section 2025-05-13 06:54:36 -03:00
Bruno Lopes
fb2167c8ad
devel-docs: Restore gitlab-mr reference but on Core Contributors section 2025-05-12 22:36:02 -03:00
Bruno Lopes
478ec9014f
devel-docs: Remove outdated info about icons (again) 2025-05-12 22:32:59 -03:00
Bruno Lopes
35bde24daa
devel-docs: Remove outdated CI explanation in favor of gitlab-ci.yml
This is already documented and updated on gitlab-ci.yml's
"There are five "TYPES" of pipelines on our CI" section so
maintaining two explanations is pointless and not future-proof.
2025-05-12 22:15:56 -03:00
Alx Sa
db040ce9e0 display: Connect path on click in design mode
Rather than having to hold Ctrl to switch to edit mode, users can now
just click the start point from the end node to create a connected path.
This makes the Path tool consistent with similar tools in GIMP
(such as Free Select, Scissor Select, and Cage Transform tools) as well
as other programs with a Path tool.
2025-05-13 00:11:05 +00:00
Bruno Lopes
a6d7bf1a8a
devel-docs: Remove sparse plug-in content in favor of Jehan nice tutorials
Despite the fact a tutorial have a different nature than a formal wiki-like text with
topics, the plug-in subject is undoubtedly well documented after Jehan and others work:

#### Basics -> https://developer.gimp.org/resource/writing-a-plug-in/tutorial-c-basic/#theory-introduction

#### Procedural DataBase (PDB) -> https://developer.gimp.org/resource/writing-a-plug-in/tutorial-pdb/

#### libgimp and libgimpui -> https://developer.gimp.org/resource/writing-a-plug-in/tutorial-c-basic/#theory-library-organization

### Programming Languages -> https://developer.gimp.org/resource/writing-a-plug-in/tutorial-python/#theory-what-about-other-bindings

### Tutorials -> https://developer.gimp.org/resource/writing-a-plug-in/#tutorial-for-gimp-30-plug-ins

### Debugging -> https://developer.gimp.org/resource/debug-plug-ins/

## Script-fu development -> https://developer.gimp.org/resource/writing-a-plug-in/tutorial-script-fu/

### Porting from GIMP 2 scripts -> https://developer.gimp.org/resource/script-fu/

## TODO: GEGL operation development -> https://developer.gimp.org/resource/writing-a-filter/

The few omissions I found were ported with:
fbf60dc5c2
2025-05-12 20:18:10 -03:00
Alx Sa
2db5875e28 tools, widgets: Don't show Fx icon for Cage Tool
Resolves #13982
This tool was missed in cc50ef99
2025-05-12 17:25:29 +00:00
Bruno Lopes
0c10e6cb98
devel-docs: Update Directory structure in gimp-data era 2025-05-12 10:08:42 -03:00
Bruno Lopes
c4e9af88bb
devel-docs: Move icons.md to gimp-data
See: e35194222b
2025-05-11 14:34:32 -03:00
Alx Sa
c92071fd28 tools: Close iscissors curve on pressing Enter
This better aligns the tool with the path tool, which also closes on 
Enter if it is not already a connected path.
2025-05-11 16:23:12 +00:00
Alx Sa
cb0f8a0282 libgimp, libgimpwidgets: Let string widgets expand horizontally
This makes GimpProcedureDialog string argument widgets expand
horizontally by default.
2025-05-11 05:50:49 +00:00
Bruno Lopes
4290f3dc7b
build/linux: Update flatpak SDK and runtime install commands
Ported from: 25ba247a96
2025-05-10 13:23:37 -03:00
Bruno Lopes
53f5a3dfd6
build/windows: Fix .hpp headers not being distributed on installer
They are rare but exist on GEGL.
2025-05-10 13:00:14 -03:00
Alx Sa
258344031c widgets: Allow color dialogues to not match the image mode
For some GUI elements, we may not want to restrict
the color options to the image mode (for instance,
grid colors on a grayscale or indexed image).

This patch adds a "user_context_aware" boolean
to GimpColorPanel so it can be passed on to set
the same boolean already in GimpColorDialog.
This allows GUI elements like GimpGridEditor to
optionally give full color choices to users,
independent of the image mode.
2025-05-10 14:18:41 +00:00
Bruno Lopes
2f7209482b
build/windows: Fix Python detection on Installer script
Following 1d5c3cbd
2025-05-10 10:27:50 -03:00
Idriss Fekir
f9de30fd6d app/tools: Always push an undo step not just when a single property changes
The behavior of the text tool was such that an undo is pushed only when a single property changes, which is obviously not expected, because, e.g. if part of the text uses a different font this means that the markup changed and all "properties" stayed the same, so an undo wouldn't be pushed.
2025-05-10 02:22:29 +00:00
Bruno Lopes
d917aef7c4
docs: Remove old 2.X series references on gimptool manpage 2025-05-09 21:40:06 -03:00
Bruno Lopes
63d2e1f871
build/windows: Set timeout for Restore Point creation
See: #13874

The process is managed by WMI so we need to
prevent stuckness that can happen in rare scenarios.
2025-05-09 21:25:12 -03:00
Bruno Lopes
1d5c3cbd43
gitlab-ci, build/windows: Standardize use of env:PATH 2025-05-09 21:24:38 -03:00
Bruno Lopes
41e8f49720
build/windows: Fix file-raw distribution on Installer 2025-05-09 21:24:33 -03:00
Bruno Lopes
ddf9d57ab6
build/linux: Fix bundling of GEGL json modules 2025-05-09 21:22:27 -03:00
Alx Sa
60fb3baa1a widgets: Update index in color-map selection when...
...color-picking on the image.

In GIMP 3.0, we now show a GimpColormapSelection when
users open a color dialogue. However, unlike the RGB color
selector it does not respond to color-picking, instead always
defaulting to index 0.
This patch adds code to get the index of the currently selected
color from the palette, and set the ColormapSelection's selected
index to that.
2025-05-09 23:07:11 +00:00
Bruno Lopes
e1efba413d
gitlab-ci: Implement "inputs:" for easier custom GUI pipelines
This new feature enables a nice panel with options on:
https://gitlab.gnome.org/GNOME/gimp/-/pipelines/new

We will still support GitLab variables.
2025-05-09 08:06:23 -03:00
Anders Jonsson
2d8fe8dbed Update Swedish translation 2025-05-08 13:07:48 +00:00
Anders Jonsson
25022abfe1 Update Swedish translation 2025-05-08 13:04:25 +00:00
Anders Jonsson
1c28093e58 Update Swedish translation 2025-05-08 13:00:54 +00:00
Øyvind Kolås
eeed283da2 build, app: depend on babl-0.1.114 and GEGL 0.4.62 2025-05-08 12:30:10 +02:00
Ondřej Míchal
3988b76e33 build/linux: Sync dependencies with Flathub flatpak
OpenEXR     - 3.3.2   -> 3.3.3
Poppler     - 25.03.0 -> 25.05.0
Ghostscript - 10.04.0 -> 10.05.1
libheif     - 1.19.7  -> 1.19.8
libde265    - 1.0.15  -> 1.0.16
SuiteSparse - 7.10.1  -> 7.10.3
2025-05-08 11:46:35 +03:00
Alx Sa
0b6fd06e19 widgets: Fix horizontal spacing of toolbox widgets
47224ba1 set the number of children in the GtkFlowBox
that holds the toolbox widgets to a constant 3. However,
this means if you only have one or two widgets shown,
there was still a horizontal imbalance.
This patch adds up the number of visible widgets whenever
that is changed, and adjust the maximum number of flowbox
children accordingly. It does add a small amount of padding at
the bottom since the invisible widgets are moved below.
2025-05-07 19:40:12 +00:00
Jacob Boerema
548bc3a46d plug-ins: CWE-190: Integer Overflow or Wraparound in Despeckle
As reported by Seungho Kim our despeckle filter doesn't check for
integer overflow when allocating buffers, nor do we check for failed
allocations.

A potential integer overflow vulnerability exists in the GIMP
"Despeckle" plug-in. The issue occurs due to unchecked multiplication
of image dimensions (width, height) and bytes-per-pixel (img_bpp),
which can result in allocating insufficient memory and subsequently
performing out-of-bounds writes. This could lead to heap corruption and
potential denial-of-service (DoS) or arbitrary code execution in
certain scenarios.

Vulnerability Details
•width and height are of type guint (signed 32-bit int).
•Multiplying width * height * img_bpp can result in a value exceeding
the bounds of gsize.
•g_new() does not perform overflow protection; if the size wraps around,
less memory than needed will be allocated.
•Subsequent pixel processing loops write beyond the allocated memory
region (src, dst).

Proof of Concept (PoC)
Open a specially crafted image with very large dimensions (e.g.,
70,000 x 70,000 pixels) and apply the Despeckle filter. GIMP may crash
due to heap corruption, or undefined behavior may occur.

We applied the suggested changes and in addition adjusted the despeckle
function to be able to set error messages, and check for NULL
allocations.
2025-05-07 14:50:11 -04:00
Jacob Boerema
d7901a8890 plug-ins, testing: add two tests for fli and ico...
based on the ZDI-CAN poc images
2025-05-07 17:57:38 +00:00
Bruno Lopes
7ead87df1e
gitlab-ci: Mention 'Image File Formats' page on feature.md
This should make file format requests less "noisy" as Jehan describes them.
2025-05-07 13:59:59 -03:00
Jehan
47e69fd4b5 NEWS: update. 2025-05-07 15:44:09 +02:00
Jehan
ae14e623a6 plug-ins: just use TRUE/FALSE instead of new macros.
Small follow-up from !2097. To be fair, looking at this plug-in's code,
we should also go much further, because so many useful types are defined
while we could use GLib types.

But I don't want to get into this cleanup rabbit hole right now.
2025-05-07 15:27:32 +02:00
Alx Sa
fb577f1833 plug-ins: Prevent infinite signal loop in legacy grid
Selecting a color in GimpColorSelection triggers
gimp_color_selection_color_changed (). In the legacy
Grid plug-in, this led to an infinite signal loop (and crash)
when changing colors when the chain link is active. Changing
one button's color would trigger the other to change, which
would trigger the first one to change again and so on.

This patch resolves the issue by blocking the signal in color_callback ()
when the other button is changed in response to the first, so that
there's no infinite chain of callbacks.
2025-05-06 17:57:55 +00:00
Nils Philippsen
85bdad2b2c Avoid type names and keywords
This fixes various errors when compiling with current toolchains and/or
-std=c23.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2025-05-06 15:31:55 +00:00
Jehan
16fe79a45f app: replace the mutex by a RW lock.
It would be more performant since it allows concurrent access as long as
you only need read access (i.e. as long as the cache won't change, which
is the most common case).
2025-05-06 14:18:09 +00:00
Jehan
7125d2c52d Issue #13617: segmentation fault when painting. 2025-05-06 14:18:09 +00:00