Commit Graph

54142 Commits

Author SHA1 Message Date
e125c30cfd Issue #12771: (gimp-layer-new) is missing.
The libgimp wrapper was just calling the PDB procedure. Get rid of the
wrapper and make the PDB proc public. Also reorder the name argument to
be in the second place, just like it was for the wrapper.
2025-01-20 20:55:48 +01:00
305303330c app, libgimp, pdb: fix a null_ok/none_ok mixup.
We had 2 flags to indicate that a PDB argument could be nullable:
null_ok and none_ok. That was a huge mixup and the PDB generation code
was using sometimes one, sometimes the other. Let's settle for only
none_ok.

This fixes a bunch of annotations.
2025-01-20 20:55:48 +01:00
d8df72869f core: Copy simulation settings when duplicating images
Among other issues, this bug impacted exporting images with CMYK
simulation profiles. Because the image was duplicated for export, we
lose the simulation profile information after
gimp_export_options_get_image () is called.
This patch ensures the profile, simulation intent, and simulation
black point compensation toggles are carried over to the new image.
2025-01-20 18:28:36 +00:00
54c92db299 plug-ins: Use GimpExportProcedureDialog for PSD export
Previously we used GimpProcedureDialog,
rather than the specialized export dialog.
2025-01-20 17:29:06 +00:00
6e3c60dd66 Issue #12760: make the metadata PDB arguments public. 2025-01-20 17:58:30 +01:00
d511efb822 libgimp, plug-ins: rename the various "save-*" metadata arguments…
… per discussion with Liam on IRC.

I should have done this sooner, not in a RC, but it's better to do it
now, rather than after 3.0 is released!
2025-01-20 17:58:30 +01:00
beecc7b723 gimp-data: Update to have proper Installer right-top icon size 2025-01-20 13:01:27 -03:00
f17a42be75 plug-ins: add type check for the argument names in filter configuration too.
After the few specific args (drawable/filter ID, opacity, blend mode, op
name…), the op argument names can be passed either as string or with the
new argument name syntax. The error message though focus on argument
name type.

Also fix the argument count for the various possible cases (when
configuring with (gimp-drawable-filter-configure) or
(gimp-drawable-merge|append-new-filter), the start arg count is
different).
2025-01-20 15:28:15 +01:00
6a85288723 NEWS: update. 2025-01-20 01:09:01 +01:00
f92f7d425c plug-ins: new named argument syntax in Script-Fu.
This syntax is now the official syntax for non-core PDB procedures.

I.e. that while core procedures will still use ordered arguments (e.g.:
`(gimp-image-get-layers 1)`), plug-in PDB procedures called from
Script-Fu will have named arguments in any order.

Say for instance that you want to call python-fu-foggify from Script-Fu.
Whereas we used to run:

> (python-fu-foggify RUN-NONINTERACTIVE 1 (car (gimp-image-get-layers 1)) "Clouds" '(50 4 4) 1.0 50.0)

Now we should call:

> (python-fu-foggify #:image 1 #:drawables (car (gimp-image-get-layers 1)) #:opacity 50.0 #:color '(50 4 4))

Now we can note:

* Every argument is preceded by a #:label which is the argument name.
  This makes these calls much more readable (some plug-in procedures can
  have dozen of arguments and these end up as list of integers, floats
  and strings, which are hard to read and hard to debug) and semantic.
* Order doesn't matter anymore. For instance here, I put #:opacity
  before #:color.
* As a direct consequence, we can drop any argument which we wish to
  keep with default value. E.g. in the old style, we had to put the
  #:run-mode, #:name ("Clouds") and #:turbulence (1.0) because we were
  changing the last argument #:opacity (50.0). Now we can drop all 3
  default arguments.

Having non-ordered argument is in fact the starter of this feature,
because it is already the case for calling PDB procedures in the libgimp
API (and therefore in all GIR bindings). By saying that the order of PDB
procedures is not part of the API, we actually allow to add arguments
and even to reorder them in the future without breaking existing scripts
in the 3.0 series.

This became even more serious when I was considering to make the generic
metadata arguments public. Since they are appended to the end, after all
plug-in-specific arguments, if I do this, adding any argument in an
export plug-in would break order. It won't matter anymore!

Note that it doesn't matter for core PDB procedures (where this syntax
is not used) because these are also C functions and therefore order and
number of arguments matter anyway. Also these don't have dozens of
arguments.

As a helper for Script-Fu developer, in particular as we already
released 2 RCs and therefore some people already started to port their
scripts, the old syntax will still work yet will produce a warning
showing how to call the same thing with the new syntax. For instance,
with the above first call, the warning will be:

> (script-fu:2059912): scriptfu-WARNING **: 22:54:47.507: Calling Plug-In PDB procedures with arguments as an ordered list is deprecated.
> Please use named arguments: (python-fu-foggify #:run-mode 1 #:image 1 #:drawables (2) #:name "Clouds" #:color '(50 4 4) #:turbulence 1.000000 #:opacity 50.000000)

Note that the argument name syntax is coming from the Racket scheme
variant: https://docs.racket-lang.org/arguments/index.html

Common Lisp has a similar syntax, either with just a colon, or also a
sharp + colon (it's unclear to me the difference, something about
interned vs. uninterned symbols).
After discussion with Liam on IRC, we decided to go with the #: syntax
of Racket.
2025-01-20 00:01:23 +01:00
751665a7bd app: gimp_pdb_query() in libgimp doesn't return private procedures anymore.
A main consequence of this is that the Procedure Browser plug-in in GIMP
doesn't show now private PDB procedures. I was always finding this
annoying as their presence in the procedure browser would encourage
people to use these in plug-ins and scripts (even when sometimes we
added explicit description that these should not be used).

Now it's clearer. The procedure are much more hidden to plug-in
developers (and if they still use them, it's at their own risk,
especially of having broken plug-ins when we change signature of these
as they are not meant to be used, and therefore we don't promise
stability for these).
2025-01-20 00:01:23 +01:00
45af19e917 app, libgimp, pdb: adding concept of core and private PDB procedures.
Core procedures are all the procedures created for libgimp basically. In
opposition, procedures created by plug-ins are not core procedures.

GimpProcedure class in libgimp now has a gimp_procedure_is_core() which
will tell you if a procedure is core or not.

Private procedures already existed, except that they were only marked as
"private" in libgimp (e.g. _gimp_font_get_lookup_name()) starting with
an underscore and marked as G_GNUC_INTERNAL. Now we also store this
information in the procedure object itself for reuse.
2025-01-20 00:01:23 +01:00
b53d88a6ac gimp-data: New Installer assets size 2025-01-19 16:58:40 -03:00
2e69cbb980 core: Use basename rather than URI for file loading
Certain cloud providers return a blobname
rather than the actual filename with
g_file_get_uri (). Since our code only checks
the suffix and extension of non-native files,
we received "Unknown File Type" when
trying to load images from those providers.

This patch replaces g_file_get_uri () so that
we get the display-name instead, which
should always have the extension. This
may be changed in the future when we
switch to a FileChooser portal.

This same pattern is also used on the
GimpThumbBox so we see the display-name
rather than the blob name.

Thanks to Khalid Abu Shawarib for the
additional information!
2025-01-19 18:28:32 +00:00
99fa22939a Issue #12424: properly disable gjs requirement at build time 2025-01-19 11:35:36 -03:00
6b13a9fff2 build/linux: Fix dangling "gimp-console*" and "gimptool*" symlinks on Flatpak
Ported from: 323972fdf5
2025-01-17 16:20:00 -03:00
0a94d27bef themes: Additional system theme leak fixes
While testing an AppImage, I noticed a thick border around the
"Show All Files" in the File Open dialogue. This is because the
background color for the actionbar is not defined, and if the internal
padding is increased by the system theme, it's visible. Therefore
we define the color.

I also noticed that the GtkSwitch had a rectangle border rather than
a rounded one. This patch defines the border radius as well.
2025-01-17 16:47:30 +00:00
44c0fc2bfd build/windows: Move 'toolchain' to unified deps list
'toolchain' package is out of the list since the earlier days of the
unified deps list (5f164ef9) to not break commands of crossroads
(https://gitlab.freedesktop.org/crossroad/crossroad/-/issues/3)
and quasi-msys2 (https://github.com/HolyBlackCat/quasi-msys2/issues/30)

Both do not support package groups, but there is a better workaround.
2025-01-16 19:02:47 -03:00
744c022791 build/windows: MSYS2/Cygwin 'base-devel' is not needed
Our Windows builds are MinGW oriented
2025-01-16 18:44:43 -03:00
c39600fcf0 build/windows: Build vanilla babl
babl docs building doesn't fail with Clang at all (ce57e91e).
2025-01-16 18:37:20 -03:00
046d79c227 build/windows: 'gpgv' is a quasi-msys2 dependency
See: https://github.com/HolyBlackCat/quasi-msys2/issues/31

As I thought in b6fb472a and 41b3dfb7, this is mostly related to apt.
2025-01-16 06:14:04 -03:00
ef8dedd109 build/linux: Complete d479eab2 (regarding Lua for AppImage) 2025-01-15 21:53:00 -03:00
d479eab25e build/linux: Add Lua support to AppImage (but not enable it, see 78665ca3)
This is one of the last pending items on GNOME/gimp!1440 checklist.
It took time because LUA_CPATH and LUA_PATH are exotic and Lua docs not good.
2025-01-15 21:21:48 -03:00
14cb6451dd Issue #12308: [macOS] dockable dialogues disabled on Windows menu.
Using the app. prefix/group for the top menu works better for the
GIMP_GTK_MENUBAR variant of the menubar (which is what is used on macOS
to get the macOS-style menu).

The whole action group code should be reviewed and straightened up
eventually!
2025-01-15 23:46:31 +01:00
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
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
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
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
b931f177d3 desktop: prepare RC3 AppStream metadata. 2025-01-15 17:22:02 +01:00
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
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
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
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
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
b6fb472ae2 gitlab-ci, build/windows: Try to fix Debian Testing 'apt' 2025-01-14 21:44:54 -03:00
728b9cdd28 Issue #12707: CRITICAL on choosing gimp-drawable-filter-update. 2025-01-14 17:58:40 +01:00
f75f585ed3 Update Spanish translation 2025-01-14 13:29:39 +00:00
9600f3cc68 build/windows: Remove unneeded line on crossbuild script 2025-01-14 07:58:46 -03:00
493fdce6ce Update Chinese (China) translation 2025-01-14 06:54:37 +00:00
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
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
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
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
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
51e719191d Issue #12712: non-configured filter throws CRITICAL when updating. 2025-01-13 20:08:16 +01:00
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
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
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
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
bd4530e580 Update Georgian translation 2025-01-12 19:51:00 +00:00