Commit Graph

51990 Commits

Author SHA1 Message Date
Jacob Boerema 7aa33bf771 app, pdb: fix #8363 gimp_selection_float() crash
Calling gimp_selection_float from a Python plug-in could make it crash
with an error like Calling error for procedure 'gimp-selection-float':
Item x cannot be used because it is not a group item.

This is caused by an incorrect check for group layers.
gimp_pdb_item_is_group returns an error when the condition is False,
while we only want an error when a group layer is selected (True).
Thus we need to use gimp_pdb_item_is_not_group, which returns an error
when the item is a group, which is what we want.

These function names are a little confusing, we might need to think
about better naming sometime.

I added C/Python tests for this function, so that we can test whether
this works correctly.
2024-04-15 18:13:32 -04:00
Jehan 140a3c82d0 Issue #10713: API versioning got broken with meson.
This is now back in sync with how it used to be up to GIMP 2.10. Basically our
API version should always be <major>.0 in the shared libraries naming, as well
as in pkg-config and docs. Otherwise we would break library compatibility with
every minor version bump.
2024-04-15 23:35:37 +02:00
Jehan d7ec3a5ca4 tools: delete a remnant from autotools paths.
Library binaries are not under a hidden .libs/ directory anymore.
2024-04-15 23:35:37 +02:00
Alx Sa 167066a468 plug-ins: Get Blue channel in Palette-Sort
Per Elad Shahar, this should be v.b instead of v.r.
2024-04-15 18:12:29 +00:00
Alx Sa 15ffc4a6c0 plug-ins: Improve FITS import error handling
Code that checked if an image was NULL was run
*after* the variable was used in a function,
gimp_image_resize_to_layers (). This patch moves
the NULL check before the function call is made.
Additionally, we now verify there are at least two axis
before trying to access indexes in the naxis array.
2024-04-14 17:20:40 +00:00
Bruno Lopes 876c709a29 gitlab-ci: Move 'image:' from deprecated global to .default 2024-04-14 13:52:29 +00:00
Bruno Lopes 18079e176f gitlab-ci, build/windows: Unify a bit Windows (cross and native) jobs 2024-04-14 10:36:04 +00:00
Martin d9694a6e38 Update Slovenian translation 2024-04-14 10:27:48 +00:00
Ngọc Quân Trần 761d740f9b Update Vietnamese translation 2024-04-14 08:01:24 +00:00
Ngọc Quân Trần 6ee9158cca Update Vietnamese translation 2024-04-14 03:10:09 +00:00
Ngọc Quân Trần 26d6aa4c6d Update Vietnamese translation 2024-04-14 03:08:43 +00:00
Bruno Lopes ad132ad0fa gitlab-ci, build/windows: Organize 'git' variables 2024-04-13 20:47:47 -03:00
Bruno Lopes 5202935db7 gitlab-ci: Make use of 'before_script' less unorthodox
Since !1171 the 'before_script' was being used by me for organization, but
this is at least unexpected to "mainstream" .yml pratice and can be wrong.
For example, the universal variables can't be properly used this way.
So, let's use 'before_script' only for the (official) purpose: save code.
2024-04-13 23:12:34 +00:00
Alx Sa 437cb6b366 plug-ins: Use correct colormap in Flame
Resolves #11292

Since the GimpProcedureDialog port, the "settings-data"
parameter has been used to save and load the selected
color map. However, the parameter was not being updated
when the user switched colormaps in the GUI - therefore, it
always used the "Custom Gradient" option.
This patch updates the "settings-data" parameter after the
change to resolve the issue.
2024-04-13 22:42:01 +00:00
Bruno Lopes 28c65b8a5f gitlab-ci: Drop x86 (aka 32-bit) cross builds for Windows
This isn't directly related with #10922 and does NOT affect 32-bit support.

After talk with @Jehan, author of 'crossroad' and main dev of crossbuilds,
we decided that the x86 crossroad builds can be dropped by these reasons:

1) 32-bit crossbuilds weren't being built. They are used since c8ec0ae7 but
after the native 32-bit builds they ended in a state that they are the only
pipeline that isn't automatically triggered in any way, a complete limbo.

2) 32-bit crossbuilds weren't being autonomous. They are not working fine
with wine32 so the win-x64-cross artifact is a 'need' and now debian-x64,
so we were spending way more time fixing than using the 32-bit cross jobs
(sometimes the 32-bit cross jobs are just broken and we even noticed).
We have other jobs not autonomous but they don't have additional bugs
like not being able to build with .mng and .wmf (32-bit cross only bugs).

---

The x64 crossbuilds will continue to be supported. They are very useful to
develop on Linux, and test MRs on Windows. I'm an assiduous user of them :)
2024-04-13 18:25:47 +00:00
Alx Sa 1f2ce6fe58 plug-ins: Fix Flame crash on interactive run
Resolves #11283

In the GUI, set_flame_preview () is connected to GimpProcedureConfig's
"notify" signal. However it is not disconnected afterwards, so it runs again
after the plug-in is finished and the "setting-data" parameter is updated.
Since the preview area no longer exists, this causes a crash.
This patch resolves the issue by storing the callback ID and then disconnecting
after the GUI is closed.
2024-04-13 17:23:45 +00:00
Bruno Lopes 694e4f382c gitlab-ci: Remove unnecessary manual _ccache/ folder creation
This was added in a22393a6 and e96b751e, following old 2_build-gimp-msys2.sh.
But, according to my tests (local and in the CI, in both Debian and Windows),
meson creates this in setup time so the manual folder creation is redundant.
2024-04-13 16:44:36 +00:00
Bruno Lopes 28f893293a gitlab-ci: Reduce redundancy on Windows cross jobs (take 3)
Following 2c2e779f and 70886e55.
2024-04-13 15:51:32 +00:00
Yuri Chornoivan 9be2e641d1 Update Ukrainian translation 2024-04-13 15:48:39 +00:00
Anders Jonsson 3f0120578d plug-ins: fix duplicate Brightness labels in Flame 2024-04-13 14:37:19 +00:00
Jordi Mas 3d5ce372f9 Update Catalan translation 2024-04-13 15:52:50 +02:00
Bruno Lopes 2c2e779f92 gitlab-ci: Reduce redundancy on Windows cross jobs (take 2)
Following 129c1637a9
2024-04-13 10:00:56 -03:00
Bruno Lopes bc8ef7998c gitlab-ci: Remove paradoxical redundancy on Windows native jobs
a22393a6 introduced redundancy while removing redundancy
2024-04-13 10:40:21 +00:00
Anders Jonsson d7c693cc57 Update Swedish translation 2024-04-13 10:04:24 +00:00
Alx Sa 2ee847d8d0 actions: Hide Preview Size dockable option if not needed
Resolves #11250

In 2.10, we explicitly hid "dockable-preview-size-menu", the submenu
for Preview Size, if there were no previews to set sizes for in the
dockable dialogue. In 2.99, this code was removed as part of the
GAction port and code clean-up.
As a result, the Preview Size submenu is always visible even if the
options have no effect on the display. To restore the 2.10 behavior,
we set each Preview Size option's visibility. If all options are hidden,
the submenu does not appear.
2024-04-13 01:43:31 +00:00
Bruno Lopes 129c1637a9 gitlab-ci: Reduce redundancy on Windows cross jobs (take 1)
Our crossroad jobs are too "sensible" and prone to broke so let's go gradually.
2024-04-12 22:02:52 -03:00
Bruno Lopes dcaaf8a48b gitlab-ci: Overall cosmetic change following e96b751e
Also, drops 'apt-cache' caching since after some experimenting with !1171
this proved to be of little use; and reorganize some dist and analysis jobs.
2024-04-12 21:57:29 +00:00
Guntupalli Karunakar b35a105f99 Add Hindi translation 2024-04-12 16:36:24 +00:00
Bruno Lopes e96b751e35 gitlab-ci: Reduce redundancy on Debian native jobs
* Move common things to the new .default section extensible for all jobs
* Reorganize order of job elements to be way more consistent and rational:
  from general (pipeline/rules) to specific (job artifacts) in a liner way
* The order of rules was changed to be a bit more easier to understand
- Drops 'dependencies' which is redudant, and 'needs' have more options
- Drop apt-cache which lost use and it is sometimes troublesome to cache
+ First try to boost the use of ccache in all build jobs, when possible
+ Fix the problem of non-failing jobs introduced by GNOME/gimp!1171
2024-04-12 16:05:42 +00:00
Jehan 9a353b9db9 libgimpwidgets: fix undeclared identifier.
Build for macOS on CI breaks with:

> ../gimp3-2.99.19/libgimpwidgets/gimppickbutton-quartz.c:210:45: error: use of undeclared identifier 'monitor_profile'
>       space = gimp_color_profile_get_space (monitor_profile,
2024-04-12 12:24:53 +02:00
Jehan ef9de3c263 app: initialize font to NULL.
In case there are no fonts loaded (which may happen in particular when starting
with --no-fonts), we need to make sure that font is initialized to NULL so that
we can return the standard GimpFont object and not a broken pointer.

Thanks to Idriss for the additional diagnosis, which would hopefully complete
commit 5dc86277e6 and take care of #11219.
2024-04-12 12:23:00 +02:00
Martin 0df73ade6c Update Slovenian translation 2024-04-11 20:05:28 +00:00
Bruno Lopes a22393a67e gitlab-ci: Reduce redundancy on Windows native jobs
This commit uses definitions and references to reduce repetition of CI code.
Some people (like the GitLab devs?) prefer (almost imposes) this to be done in
multiple .yml's using 'worfklow:' but this makes the CI way more complicated
and very slow to read. So, let's just keep simple in one human readable file.

---
Other changes are:
- The custom native arch pipelines now they always generate a .zip package.
  This helps to ensure that everything is in place and facilitate testing;
- The pacman update (-Syyuu) was removed since it is auto done by runners;
- The ccache config was moved to .yml. This does NOT affect local builds
  since meson saves ccache by default for user in '%LocalAppData%/ccache'.
2024-04-11 19:02:49 +00:00
Cheesequake 702d5e1e80 Issue #11071: Changed detailed_signal from "map" to "realize" to enable opening animations 2024-04-11 14:59:15 +00:00
Bruno Lopes 4652022368 gitlab-ci: Expose job artifacts in UI
Makes a bit easier to newcomers download the main artifacts in MRs.
(This feature doesn't support variables or wildcards in paths)
2024-04-11 07:42:13 -03:00
Yuri Chornoivan c7b2bacbe2 Update Ukrainian translation 2024-04-11 10:28:06 +00:00
Jehan 5dc86277e6 app: set font factory as GimpFont class member regardless of fonts being loaded.
Previous code would only set the class member when we were actually
loading fonts, so we ended with code paths where the member was NULL.

Fixes:

> GIMP-CRITICAL: gimp_container_get_n_children: assertion 'GIMP_IS_CONTAINER (container)' failed

It should hopefully also fix #11219 (though I couldn't reproduce this
failure).
2024-04-11 12:15:59 +02:00
Jehan 3001c2d523 plug-ins: fix include.
This will fix the following warnings:

[1/30] Compiling C object plug-ins/script-fu/libscriptfu/libgimp-scriptfu-3.0.so.0.9900.19.p/script-fu-version.c.o
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:49:1: warning: no previous declaration for ‘begin_interpret_v3_dialect’ [-Wmissing-declarations]
   49 | begin_interpret_v3_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:55:1: warning: no previous declaration for ‘begin_interpret_v2_dialect’ [-Wmissing-declarations]
   55 | begin_interpret_v2_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:62:1: warning: no previous declaration for ‘begin_interpret_default_dialect’ [-Wmissing-declarations]
   62 | begin_interpret_default_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:69:1: warning: no previous declaration for ‘is_interpret_v3_dialect’ [-Wmissing-declarations]
   69 | is_interpret_v3_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~
2024-04-11 10:47:20 +02:00
lillolollo 9f86d6b8d0 libgimpwidgets: Replace deprecated CGColorSpaceCopyICCProfile with CGColorSpaceCopyICCData 2024-04-11 01:28:16 +00:00
Alx Sa 49c820e620 dialogs: Use error variable in Welcome Dialog
Resolves #11256

A GError variable was created but not passed to
file_open_with_display () when opening recent files.
As a result, if an error did occur the variable would be
used while it was still NULL. This patch fixes this
by passing a reference to error as the last parameter
of file_open_with_display ().
2024-04-11 01:25:42 +00:00
Anders Jonsson 8e8d2dd4c4 plug-ins: mark DDS progress strings as translatable 2024-04-10 15:30:00 +00:00
Jacob Boerema 5bda6e0623 plug-ins: fix failure to load certain mipmapped DDS images
We compute the size of the mipmapped layers wrong. We assume that
width, height are always exactly a power of 2, which is the normal case
for dds images. See issue #11256.

Since other sizes are possible, we adjust this by computing the width
times height times bytes per pixel of the current mimmap level.
2024-04-09 13:33:36 -04:00
Alx Sa f346b1783b widgets: Disable DrawableChooser if no layer/channel selected
Resolves #11075

In the DrawableChooser pop-up, choosing an image without
also picking a layer or channel causes the pop-up not to
reappear on subsequent attempts to click it. This is because
the callback is only recreated when the drawable is updated,
and choosing just an image does not update the drawable.
For 3.0, we'll set the Okay button to insensitive unless a layer
or channel is picked.
2024-04-09 12:51:30 +00:00
Alx Sa f726efba76 Don't convert to float before storing...
...in GeglColor. Just use the "u8" format.
2024-04-09 00:48:35 +00:00
Alx Sa cc74d40769 libgimpwidgets: Port GimpPickButton to GeglColor
Also have "color-picked" signal send a
GeglColor object rather than GimpRGB.
2024-04-09 00:48:35 +00:00
Jacob Boerema 97e29cb7f6 plug-ins: some improvements to Photoshop layer reading code
I added a few improvements to how we load the Photoshop layers:
- When included from TIFF, we forgot to decrease the data_length for
the parts we already read.
- Also when included from TIFF, we need to skip the global layer mask
info.
- The block length for the layer data needs to be a multiple of 4.
- Catch an invalid data condition where block_len is greater than
total_len. This could cause a change total_len to a very large
value, so protect against that.
2024-04-08 18:07:33 -04:00
Jacob Boerema c4de209322 plug-ins: incorrect size of Photoshop metadata in TIFF
When loading Photoshop metadata from TIFF images, the size of the data
in the temp file was often incorrect.
This happens because run_mode is usually GIMP_RUN_INTERACTIVE when
run from within GIMP. In interactive mode, the last saved config values
take precedence over the ones set in the function call, which is not
what we want in this case.
We would prefer to use interactive here, because then we can show a
dialog with a list of unsupported Photoshop features that were found
inside the image.
For now, we will use GIMP_RUN_NONINTERACTIVE and accept that we can't
do that at this time. This way we will at least have the correct values
when processing the Photoshop data.
2024-04-08 18:07:32 -04:00
Jacob Boerema 61614a39ca plug-ins: fix reading Photoshop clipping path
The clipping path values are all 2 bytes, but we were only reading in
1 byte for each value. In addition to that, the path_flatness_fixed
value was not converted to the correct Endian representation.

Since these values are usually 0 and get clamped to valid values, this
went unnoticed until now.
2024-04-08 18:07:31 -04:00
Jehan adb479a63e plug-ins: fix warnings in recent libscriptfu commits.
Fixes 2 such warnings:

> warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]

As well as:

> warning: conversion lacks type at end of format [-Wformat=]

And:

> warning: no previous declaration for ‘reset_output_port_struct’ [-Wmissing-declarations]
2024-04-08 20:43:27 +02:00
Jehan 378e80408d meson: share a same environment for all usages of self-built GIMP
In particular GIMP used for unit-testing, or in other cases as a build tool,
from the non-installed binaries, can use a same meson `env` object.
2024-04-08 20:30:51 +02:00