Commit Graph

51748 Commits

Author SHA1 Message Date
bootchk 98bf051e7a Fix #10044 more natural binding of PDB return values
Allow (script-fu-use-v3) in script, or in SF Console.

Definitive description is in script-fu/docs/using-v3-binding.md

Makes SF interpret v3 of SF dialect.
  - marshals single return value from PDB without wrapping in list
  - marshals boolean return value from PDB as #t #f instead of integers
  - marshals boolean to PDB from #t and #f or TRUE and FALSE
  - marshals void return from PDB as () instead of (#t), but that is moot.

The version of SF dialect is distinct from the version of the PDB API.

Dialect v3 is opt-in: the initial dialect of all SF tools remains v2.

Commit also allows #t,#f for defaults of SF-TOGGLE instead of TRUE, FALSE
but that is an independent enhancement (but closely related.)

Affects interpreter state of the current process.
Not an attribute per se of a plugin.
While in this state, a plugin should not call PDB procedures
which are themselves v2 script plugins,
or a few utility scripts in script-fu-util.scm,
but that is rarely needed.

Does not remove symbols TRUE and FALSE from dialect.

A script can also call (script-fu-use-v2) to revert.
That is also discouraged but useful e.g. for testing.
2024-03-09 07:21:50 -05:00
Alx Sa d4af93b256 libgimpcolor: Fix CAIRO_FORMAT_RGB96F babl format
As noted by Idriss, this should most likely be R'G'B' instead.
2024-03-08 20:56:32 +00:00
Anders Jonsson b0cec7c771 Update Swedish translation 2024-03-08 19:53:48 +00:00
Anders Jonsson 0d512085f3 menus: move menus to submenus of tab menu
Fixes #9883

    There were menus that put their entries
    directly in the tab menu rather than in a submenu.

    This moves them to submenus to bring back GIMP 2.10 behavior.

    Stray entries added by scripts are also moved to the right
    submenu.
2024-03-08 17:48:38 +00:00
Kamil Burda 08c1fdc719 plug-ins: Replace guchar PDB parameters with more appropriate types
For improved readability, int or boolean types are used in place of
guchar for PDB parameters where the parameter description better fits
one or the other type.

This change affects `plug-in-alienmap2` and `plug-in-maze`.

Also, the problem with `guchar` parameters is that they currently cannot
 be modified via `GimpProcedureConfig` due to the type not being
supported.
2024-03-08 14:08:05 +00:00
cheesequake 905e8777a7 Fixes #11000: Cut now clears out the selection properly 2024-03-08 14:01:07 +00:00
bootchk b854db9666 ScriptFu: fix #11013 ts-hello-world.scm crashes at query time
Call gimp_ui_init during query phase as well as run phase.

Maybe gimp_main() should do this.

Since space invasion from GimpRGB to GeglColor,
plugins that declare defaults for formal args of type GeglColor
need babl and gegl at plugin registration time.
2024-03-08 08:16:20 -05:00
bootchk a2f01ff5f1 Test: add color/pixel related tests
Add more tests of selection by shape

Add test! statement to the test framework.
2024-03-08 11:49:38 +00:00
Bruno Lopes 3c129a79d5 build: Drop 'docker' draft folder
The 'Docker' draft of GIMP was introduced in 09/04/2017 and then died ONE day
after, mostly because of "bad" timing (few years later we moved to GitLab CI).

Similar (in fact, even worse) than 'jhbuild' folder, update it to keep the
current development status is so hard that it is equal to do it from scratch.
So it is reasonable to delete it anyway.
2024-03-08 10:15:29 +00:00
Yuri Chornoivan d3e37fa538 Update Ukrainian translation 2024-03-07 21:39:09 +00:00
Philipp Kiemle 5460687766 Update German translation 2024-03-07 21:24:22 +00:00
Martin aef14ef721 Update Slovenian translation 2024-03-07 18:41:09 +00:00
Martin 7d46e0c6b4 Update Slovenian translation 2024-03-07 18:31:24 +00:00
Martin 52c5869cae Update Slovenian translation 2024-03-07 18:30:11 +00:00
Martin 9fd37c82b3 Update Slovenian translation 2024-03-07 18:27:52 +00:00
Martin 4065f3fba4 Update Slovenian translation 2024-03-07 18:25:10 +00:00
Jacob Boerema 4bf2c1e1ba plug-ins: fix #10903 Missing metadata in OpenEXR images from darktable
Due to changes in our metadata handling API for plug-ins, the exif and
xmp metadata read from exr images was being overwritten by empty
metadata.

Fix this by following the new API and also add messages when loading
metadata fails. That way it will be easier to catch in the future if
metadata loading gets broken again.
2024-03-07 13:12:08 -05:00
Jacob Boerema 0585bc11d4 plug-ins: fix incorrect size when comparing jpeg exif marker in EXR loader
When defining jpeg_exr a closing \0 is automatically added by the
compiler. So when we compare it using sizeof, we do not compare
6 bytes but 7. Since there won't be three 0's, this will fail.

Fix this by reducing the size by 1 and also update the comment to
make this clear and further to add that this was changed after
darktable 4.0.0.
2024-03-07 13:12:08 -05:00
Jacob Boerema f00ad15b7b libgimpbase: fix loading exif data from buffer
gimp_metadata_set_from_exif has special code for handling old-style
GIMP exif parasite data, but didn't check for the more common case
of loading exif data from image formats that can't be handled by exiv2.

The exif data in these formats usually start with the TIFF endian
markers instead of "Exif", which caused a failure to read this
metadata for e.g. EXR images, see issue #10903.

We change this function to check for "Exif" at the start of the data,
in which case we assume it to be the old-style exif parasite and in
that case add extra metadata as was previously always done.

In all other cases, we do not add extra metadata.
2024-03-07 13:12:08 -05:00
Kolbjørn Stuestøl 0c6c3d5347 Update Norwegian Nynorsk translation 2024-03-07 15:51:52 +00:00
Kolbjørn Stuestøl 7a5fd3120f Update Norwegian Nynorsk translation 2024-03-07 15:30:50 +00:00
Yuri Chornoivan 06fa6bad89 Update Ukrainian translation 2024-03-07 14:20:26 +00:00
Bruno Lopes b51e0bc464 build/windows: Update some Installer strings
- Remove obsolete GtkWimp and Compat strings
* Update 32-bit string
2024-03-07 10:42:34 +00:00
Bruno Lopes a0512f5aae build/windows: Clean *gimp3264.iss regarding 2.0 series InstallDelete
These files are not deleted when the Unstable (GIMP 2.99) or Stable (GIMP 3)
version are installed because the root is different. So, they can be removed.
2024-03-07 10:08:34 +00:00
Sabri Ünal bc6252dcdf Update Turkish translation 2024-03-07 09:24:32 +00:00
Sabri Ünal e0853f9141 Update Turkish translation 2024-03-07 09:24:28 +00:00
Alx Sa 63ea1e2b5f plug-ins: Get monitor after screenshot dialogue
Resolves #11004

During the port to GimpProcedureDialog, the code
that assigned the current monitor object for
Windows and MacOS was accidentally removed.
This patch restores this code in the proper place.
2024-03-07 03:14:48 +00:00
Alx Sa 69314ba087 tools: Add NDE support for group layers
This patch allows NDE filters to be
applied to group layers as well.
The "merge down" function is disabled.
2024-03-06 22:04:28 +00:00
bootchk 71b41c68c2 ScriptFu: fix #11010 unhandled return type GimpColorArray
Add a case to the marshalling of return types from the PDB,
for the new type GimpColorArray.

test case is gimp-palette-get-colors in tests palette.scm
2024-03-06 14:48:41 -05:00
bootchk 4c16b20d69 2.99 Tests: add more tests
Add tests of Drawable.
2024-03-06 10:45:44 -05:00
bootchk 279341a237 ScriptFu: fix #11001
At script create time, create a GimpRGB i.e. pixel from the declared name of default color.

At plugin procedure registration time, convert that pixel to GeglColor,
and use that color to declare the color arg using GeglParamSpecColor(default=color)

Fixes a faulty fix a few commits back where we lost the declared color name.
The proper dataflow is  name->color->paramspec-with-default-color.
2024-03-06 09:55:38 -05:00
bootchk f7c876dfd3 2.99 ScriptFu: refactor, extract methods of color and resource
Extract methods related to color into new file.
So method names document what is being done.
So related code is together.

Ditto for resource.

No functional change.

Preparing for changes to reset/default and changes to representation of pixels
in lists of differing lengths rgb vs rgba.
2024-03-06 08:07:11 -05:00
Idriss Fekir 0f32312e26 widgets: Fix error on text color selection
Resolves #11003

GeglColor defaults to NULL rather than black like
GimpRGB. When selecting text with two or more colors
in the total selection, this causes NULL to be passed
to gimp_color_button_set_color () which throws an error.
This patch resolves the issue by setting GeglColor to
black if it's NULL before the call.
2024-03-06 06:37:13 -05:00
Yuri Chornoivan a905208873 Update Ukrainian translation 2024-03-05 20:09:50 +00:00
Alx Sa 0c26cd442a operations: Port semi-flatten to GeglColor
After the color space invasion, the
Semi-Flatten GUI was broken since it still
used GimpRGB as its color property.
This patch fixes this by porting to
GeglColor. The GimpRGB conversion was
also removed from the PDB interface
since the GeglColor comes directly from
GimpContext.
2024-03-05 18:30:53 +00:00
Rodrigo Lledó 29cac9eaef Update Spanish translation 2024-03-05 12:35:40 +00:00
Rodrigo Lledó 98894383dd Update Spanish translation 2024-03-05 12:06:13 +00:00
Luming Zh c7b6444543 Update Chinese (China) translation 2024-03-05 08:52:42 +00:00
Alx Sa 625b74ea00 pdb: Update text-layer-set-color to GeglColor
Resolves #10992.

GimpTextLayer's color attribute was
updated from GimpRGB to GeglColor,
but gimp-text-layer-set-color still passed
in GimpRGB. This patch updates the PDB
call to match the property type.
2024-03-05 01:42:22 +00:00
cheesequake 1a76346ed5 Fixes:#10933 context swatch crash issue 2024-03-04 21:10:36 +00:00
Jacob Boerema a22a2a5b15 plug-ins: fix overwriting a GError in PCX loader
In the previous commit I overlooked one other case where the GError
can be overwritten. Fix this by using g_prefix_error.
2024-03-04 15:53:06 -05:00
bootchk b2af8b6c2c ScriptFu fix #10982 broken build, and spurious CRITICAL
Fixes errors introduced by my prior commit c0ca0b74

1. SF is storing colors in GimpRGB, not GeglColor.
Storing using wrong pointer type seemed to work, but would not build on newer compilers.

2. spurious error message "CRITICAL....Two different plugins tried to register..."
Due to calling gimp_ui_init too early, in the class instance init.
2024-03-04 17:21:17 +00:00
Jacob Boerema 4cb6ee45a1 plug-ins: fix double free when loading invalid PCX image
When testing on Debian with acertain invalid PCX imagea that return
"Invalid number of bytes per line in PCX header", we get an error:
free(): double free detected in tcache 2
On Windows this doesn't cause an error, most likely due to a different
implementation of fclose.

The problem is that in case of errors fclose was called twice. Since
the file is opened outside the load_image functions, let's handle
closing also only outside that function.

In addition to that, change all g_message error notices to use
g_set_error instead, that way we always return a GError in case of an
error.

Further we also fix a possible error case of overwriting an existing
error by using g_prefix_error when the error is already set.
2024-03-04 11:32:42 -05:00
Alx Sa 2f94edfe8c tools: Switch to GeglColorButton for mask-color
Resolves #10990.

Since the "mask-color" property is now a GeglColor,
we need to use gimp_prop_gegl_color_button_new ()
rather than gimp_prop_color_button_new () to
display it in the options panel.
2024-03-04 12:17:26 +00:00
Emin Tufan Çetin fa5373d99a Update Turkish translation 2024-03-04 01:11:02 +00:00
Alx Sa d055564d26 xcf: Save/Load color property for NDE filters 2024-03-03 21:07:37 +00:00
Yuri Chornoivan 387503507c Update Ukrainian translation 2024-03-03 19:10:28 +00:00
Martin d9c33636a3 Update Slovenian translation 2024-03-03 16:25:45 +00:00
Anders Jonsson 97e19ff931 plug-ins: mark xmc tooltips as translatable 2024-03-03 11:25:19 +01:00
Luming Zh e0dab4172f Update Chinese (China) translation 2024-03-03 08:48:31 +00:00