Commit graph

53918 commits

Author SHA1 Message Date
Jacob Boerema
6b10cce682 app, libgimpbase: add creation date/time metadata...
when creating a new image.

We add a new function `gimp_metadata_set_creation_date` to
`libgimpbase/gimpmetadata` to handle setting all relevant
metadata tags.

We add a local function `gimp_image_new_add_creation_metadata` to
add the creation date metadata to relevant functions that create
new images.
We write tags for both the creation date and several modified dates
for IPTC, XMP and Exif metadata. All these use different ways to
express date/time and timezones and I can already see we need to have
another look at other places where we handle modified dates.

This solves the second part of #7287, adding metadata about the
date/time a new image was created.
2025-01-15 16:54:22 -05:00
Jacob Boerema
4ff4ce2870 app: fix #7287 failure to save metadata when creating a new image
When starting from an image we created in GIMP, saving/exporting with
metadata and/or thumbnail (thumbnails are part of the exif metadata)
failed, because our metadata was not initialized for newly created
images.

To fix this, create a metadata object in `gimp_create_image`, that way
when creating a new image in the gui, but also when creating an
image programmatically, gets metadata attached at the start.

We need to do that here, because we need to have metadata available
even for images that we import that do not have metadata attached.
2025-01-15 16:54:21 -05:00
Jehan
f373186dfd app: fix a crash when closing an image.
A flush happens when closing image displays, and with the idle code, it
means that the actual flush may happen once the image is already freed.

When I was saying that multi-threading is always full of surprises…
2025-01-15 18:43:36 +01:00
lloyd konneker
a00fee46af libgimp: fix #12631 set can_recurse on watch on msgs from core
So plugins don't block on second wire msgs for callbacks from remote
core chooser dialogs.
Makes libgimp/plug-in more similar to core/plug-in
2025-01-15 17:20:05 +00:00
Jehan
b931f177d3 desktop: prepare RC3 AppStream metadata. 2025-01-15 17:22:02 +01:00
Jehan
de0c08ace8 NEWS: new section for 3.0.0 RC3.
It became clear we need a RC3, mainly for 3 reasons (ordered with first
ones being more serious issues) for which I think more testing would be
better:

1. The changes in the image graph, regarding filters (#12614), and
   possibly more than I am thinking of doing before RC3.
2. The change in multi-threading code for paint (#11389). I want to be
   sure not to create new crashes (multi-threading is always full of
   surprises!).
3. The change to a central plug-in API implementation (!2058) and I want
   to make sure it doesn't bite us back with more testing (though it is
   only for persistent plug-ins so it is fortunately not touching every
   plug-in).
2025-01-15 16:59:50 +01:00
Jehan
c237b12d12 Issue #11389: crash when using layer auto-expansion.
The fix is basically to make gimp_projection_flush() thread-safe, so
that it can be called from any thread.

The actual rendering was actually already run in the main thread since
it was in an idle function, but update_region could be touched both from
the main thread and another thread (e.g. the "paint" thread). An
alternative could have been to put some mutex to protect usage, but then
I realized that iter variable was also to be protected, and there was
some code where I am unsure if we had to protect larger parts of code
(in particular with gimp_projection_projectable_bounds_changed() which
was touching update region through gimp_projection_chunk_render_stop()
then directly). The nice headaches of multi-threading!

Moving the whole actual logic of gimp_projection_flush() in the main
thread seems much more robust and maintainable.
2025-01-15 13:07:17 +01:00
Jehan
0c7168bf32 Issue #12732: fix "libxml2 error: unterminated entity reference" errors.
xgettext changed its default behavior since version 0.23 regarding
escaping of special characters into XML entities. Now we need to change
the gt:escapeRule value, differently depending on xgettext version (it
will fail in both cases with the wrong value, except the "wrong" value
is the opposite before and after).
2025-01-15 11:09:00 +00:00
Bruno
41b3dfb70f
Revert "gitlab-ci, build/windows: Try to fix Debian Testing 'apt'"
This reverts commit b6fb472ae2.

We need to always have apt output since Debian Testing is tricky.
2025-01-15 06:20:25 -03:00
Jehan
135935c448 Revert "Issue #7539: Opening some images lock GIMP."
This reverts commit 9b94e347bc.

I leave a comment though, because we are not 100% sure that the issue is
gone. In fact, the upstream report is still opened.

The good point is that on stable code, we only debug crashes by default,
while the specific hang we had was happening with debugging metadata
warnings. So hopefully we won't have random people reporting GIMP
hanging (only people explicitly trying to help debugging GIMP).
2025-01-15 01:48:02 +01:00
Bruno
b6fb472ae2
gitlab-ci, build/windows: Try to fix Debian Testing 'apt' 2025-01-14 21:44:54 -03:00
Jehan
728b9cdd28 Issue #12707: CRITICAL on choosing gimp-drawable-filter-update. 2025-01-14 17:58:40 +01:00
Rodrigo Lledó
f75f585ed3 Update Spanish translation 2025-01-14 13:29:39 +00:00
Bruno
9600f3cc68
build/windows: Remove unneeded line on crossbuild script 2025-01-14 07:58:46 -03:00
Luming Zh
493fdce6ce Update Chinese (China) translation 2025-01-14 06:54:37 +00:00
Alx Sa
150f3a3274 dialogs: Don't show Releases Notes if none exist
If the generated `gimp_welcome_dialog_n_items` variable
is 0, there are no release notes to show (likely because
this is a development version). Therefore, we don't create
the Release Notes tab in the Welcome Dialogue.
2025-01-14 04:02:56 +00:00
cheesequake
84e58c5704 widgets: Confirm color map selection before...
...trying to get index.
When changing images or detaching a Colormap dockable,
we may temporarily not have a selection when the GUI
actions update. This patch adds a check to confirm we
have a valid selection before trying to get an index
from it.
2025-01-14 03:01:14 +00:00
Jehan
4448b1054a plug-ins: remove GIMP_PARAM_NO_VALIDATE for resource arguments.
We validate arguments for a reason. This special flag must only be used
in special cases (when it's harder/not possible or not implemented yet
to validate properly).

In fact #12039 would have been much simpler to diagnose and debug if
this flag had not been there from the start, because we would have had
an error earlier, on core side, which we could have traced back much
more simply!
2025-01-14 00:49:33 +01:00
Jehan
d42c76cf09 Issue #12039: do not set NULL to the first non-standard plug-in arg.
We had special code to pass around a special config object for some
filters but it was just looking if this first "non-standard" (after run
mode, image, drawables…) was an object and inserting the settings
object, which turns out to be NULL in most case (except for these
special filters from the filters_settings_actions list).

This is not right, first because we may override the default value in
such case, second because, even if this arg may be overrided later
depending on run mode, it is possible that this random other
(non-config) argument may not even allow NULL to begin with. This was
what was happening in #12039.
2025-01-14 00:13:21 +01:00
Rupert
e51b84e77b Issue #12717: file-bmp plugin broke cross-build with generated source
- build 'generate-huffman' natively when cross-building
- also reenable build of file-bmp for cross-builds
2025-01-13 22:36:41 +00:00
Jehan
51e719191d Issue #12712: non-configured filter throws CRITICAL when updating. 2025-01-13 20:08:16 +01:00
Bruno
40d38b0f9f
gitlab-ci: Remove very obscure 'hicolor-icon-theme' dependency
GIMP have its own hicolor in 'share/gimp/*/icons/hicolor' since 2.99.2.

Removing that package made no difference to the resulting AppImage and
I could not find any indication on our tracker about its necessity.
2025-01-13 09:37:21 -03:00
Jehan
210ec64283 app: merging all filters should use the filter stack render.
Committing every filter one by one had the same drawback as in #12614,
and as destructive effects in general: you have to go back to source
storage precision after every layer. This really shows its limits when
this precision is low (8-bit per component) and/or when the TRC loses
even more data (linear TRC in 8-bit is usually not a good idea) as shown
in the report.
So instead, use the render of the last active filter directly and switch
the drawable's buffer with it.
2025-01-12 22:18:28 +01:00
Jehan
a3a7fb0983 app: make sure that reordering filters sync formats.
Otherwise when reordering but also when undoing (which does a reorder),
the applicator's convert nodes are not properly set.
2025-01-12 22:18:28 +01:00
Jehan
2c066afff9 Issue #12614: Successive layer effects should use a higher bit-depth as intermediary format.
While it's normal to be limited to the storage precision at drawable
level, we want to have as high precision as possible during processing.

Two pieces of code were problematic in this regard:

1. GimpApplicator had a "gegl:convert-format" node which was converting
   back to storage format after every effect. Instead only set this node
   after the last effect.
2. "gimp:mask-components" operation was working with the input format.
   Let's change this to work with the higher precision when comparing
   input and aux format (typically when aux was the output of a previous
   filter, now that we didn't convert format back to storage precision,
   the aux precision may be bigger).
2025-01-12 22:18:28 +01:00
Ekaterine Papava
bd4530e580 Update Georgian translation 2025-01-12 19:51:00 +00:00
Alx Sa
54405ddd0f libgimp: Respect alpha setting in color widgets
When creating a color widget in GimpProcedureDialog, we
were not taking into account whether the parameter's
has_alpha boolean was set to FALSE. As a result, all color
widgets allowed for transparency.

This patch checks if the GimpColor's GParamSpec has_alpha value
is FALSE, and if so, sets the color widget's type to
GIMP_COLOR_AREA_FLAT to enforce no transparency for that color.
2025-01-12 19:10:27 +00:00
Alx Sa
2dd55d117c core: Don't assume filter has single operation
Resolves #12719 and #12721
In b78f3dad, we assume that a filter is being created for a
single operation. However, certain tools like Bucket Fill might
pass a GEGL Graph node instead. This causes the call to
gegl_node_get_gegl_operation () to return NULL, which then
crashes when we attempt to get the Operation Class.
This path verifies that we have a single operation before
attempting to go further with getting its class.
2025-01-12 13:42:42 +00:00
Bruno
d4a7175a0f
build/windows: Crossbuilds are back and with UCRT (thanks to 'quasi-msys2')
Fixes: #11756

Context: Debian Bookworm only have GCC that links to MSVCRT C library.
Actually, crossroads is failing on our CI probably due to GCC-MSVCRT.
On Debian, there is GCC-UCRT too but it is marked as Experimental and
crossroad does not support it nor Clang-UCRT yet: GNOME/gimp!1860.

Some people reported crossroad working with GCC-MSVCRT in Fedora but
adding a brand new pipeline would be at least suboptimal to mantain.

So, we are temporarely moving from crossroad to quasi-msys2 project which
have UCRT support for both GCC and Clang (it takes compiler resources from
MSYS2). The compilers itself we will take from Debian Testing for parity
(they are standard GCC and Clang with proper CFLAGS set by quasi-msys2).
We may go back to Crossroad when it has UCRT support like quasi-msys2.
2025-01-11 18:32:39 -03:00
Alx Sa
b78f3dadc6 core, pdb, xcf: Only load explicitly set filter names
We always save the filter name in XCFs,
even if the user did not intentionally set
it. This means that "default" names like
Gaussian Blur are not translated when
saved and loaded in XCFs.

This patch adds a new property,
"custom-name", to GimpDrawableFilter.
It is FALSE by default, and only set to
TRUE if the user provides a custom filter
name (currently only possible in the
public filter API). Based off this value,
we either use the saved filter name or
get it from the operation when saving and
loading a filter from the XCF.
2025-01-11 21:28:41 +00:00
Alx Sa
73f30b0dc6 plug-ins: Import DDS BC7 compression
This patch adds support for importing DDS images
with BC7 compression. The implementation references
ImageMagick's method.
2025-01-11 16:51:09 +00:00
lloyd konneker
994aa79724 ScriptFu: tests: test DrawableFilter class and its use sequences
No changes except to tests.
2025-01-11 10:07:40 -05:00
Alx Sa
c9ccb77287 themes: Define background-image for entry and switch
Resolves #12682
Some system themes add a gradient background-image to
text input and toggle widgets. On dark theme, this can
make the text unreadable if the background-image is a similar
color. This patch defines the background-image as none, to
prevent the system theme from leaking in.
2025-01-11 13:55:59 +00:00
Alan Mortensen
8953232359 Update Danish translation 2025-01-11 09:46:54 +00:00
Ngọc Quân Trần
04e1f830a7 Update Vietnamese translation 2025-01-11 06:44:14 +00:00
Jehan
d8a8d2f138 app: the "color-options-expanded" filter option is now bogus.
I missed this together with commit c3ef79b3ef. It's of no use now.
2025-01-10 23:43:31 +01:00
Jehan
bc3b6e5927 app: do not migrate option (filter-tool-show-color-options). 2025-01-10 23:26:11 +01:00
Jehan
c3ef79b3ef Issue #12577: get rid of the gamma hack.
What it was doing was casting the input buffer to another TRC, basically
pretending the data was what it was not. In particular, it was casting
linear input buffers to non-linear and all other TRCs to linear.

As was noted in #1958, this was in fact a useful trick, yet it's still a
trick. Basically when it's needed, it's either:

1. because the operation implementation does not work in the technically
   correct space. Then the operation code should be fixed;
2. or because several work TRC are valid, then an option should be
   proposed by the operation;
3. or for artistic reasons, which people are free to implement as
   plug-ins or third-party filters, but it should not be a core GIMP
   feature.

Therefore for most cases where it felt needed, the real solution will be
to improve the operations' implementations.
2025-01-10 23:26:11 +01:00
Jacob Boerema
496b390724 app: add help-ids to the vector tool path actions
These were missing help ids and don't have tooltips either, while some
of these actions may not be clear to end users what they do.

This will allow us to have context sensitive help about these commands
in the manual.
2025-01-10 13:52:49 -05:00
Jehan
6f197416ec libgimp: switch the relative path to full path.
Without this, the relative path alone was not working fine, likely
because current working directory is not the plug-in dir.
2025-01-10 18:59:37 +01:00
Jehan
49e2abd9ad Issue #12326: Bug in locale directory checking in gimpplugin.c. 2025-01-10 18:43:31 +01:00
Jehan
df6d9b63f7 app: fix localization of plug-ins on Linux.
This regression was added with MR !1551 (commit 7ccfad1716).
Localization was still working fine on the main processus, which made
the problem less obvious. But every plug-in would output such an error
on start:

> (border-average:257681): Gtk-WARNING **: 17:22:17.640: Locale not supported by C library.
> 	Using the fallback 'C' locale.

And the localization was indeed not working.
Apparently having a properly qualified locale, with both region and
encoding (e.g. "fr_FR.UTF-8") is fine, but any other contents was
breaking the whole locale.

Since it seems that this issue doesn't happen on Windows at all, let's
just not set LANG, except on Windows.
2025-01-10 18:43:31 +01:00
Jacob Boerema
473d07d364 plug-ins, exr: ensure dimensions are not outside our limits...
when loading an exr image.
While looking at the openexr fuzzed images I noticed we do not check
whether height or width are larger than our maximum.

Although this was caught in libgimp when trying to create the image,
let's add checks in the exr plug-in itself.
2025-01-09 18:32:50 -05:00
Rupert
565ead32b8 plug-ins: bmp import - simplify dest/offset handling
the offset to the dest buffer passed to the line-reading functions
wasn't counting bytes but items/values, which was slightly confusing.
Changed to not pass the offset at all, but rather a pointer to the
start of a line inside the buffer.
Also made rowstride count bytes, not values.
Made dest and rowstride local vars, as they are not used anywhere else.
2025-01-09 23:04:02 +00:00
Rupert
373f4821c3 plug-ins: bmp import - explicitly include RLE24 when setting channels...
...and precision
2025-01-09 23:04:02 +00:00
Rupert
71205f5b4e plug-ins: bmp import - height check was missing ABS()
bmp height can be negative
2025-01-09 23:04:02 +00:00
Rupert
b702a8b5c5 plug-ins: bmp import - move set_default_masks() next to other mask funcs 2025-01-09 23:04:02 +00:00
Rupert
8ffa8d1c98 plug-ins: bmp import - simplify digest_masks() 2025-01-09 23:04:02 +00:00
Rupert
d48ce04291 plug-ins: bmp import - add/clarify some comments 2025-01-09 23:04:02 +00:00
Rupert
5db4955d4d plug-ins: bmp import - rename rowbytes -> bytes_per_row
variable with identical purpose had different names in import and
export plug-in.
2025-01-09 23:04:02 +00:00