Commit Graph

9768 Commits

Author SHA1 Message Date
Bruno Lopes 9c0cc6ab98 plug-ins: Don't build ScriptFu interpreter and server in crossbuilds
Since !1171, ScriptFu .scm and .interp files aren't available to prevent
errors caused by no instrospection support, but this binaries escaped.
2024-01-15 15:04:30 -03:00
Anders Jonsson 9838c9f65f plug-ins: fix crash on export to xmc
Fixes #10605.

Export to xmc when image width or height is 256 pixels
causes a crash. Add equality check to an assert to stop
the plug-in from crashing.
2024-01-15 14:50:58 +01:00
Alx Sa bb588155fd plug-ins: Fix ImageMap resize bug in GTK3
Resolves #10530.

In GTK2, setting a window's scrollbar policy to GTK_POLICY_NEVER
hid the scrollbars. In GTK3, this also makes the window automatically
resize to fit the contents. Since ImageMap displays the full drawable
with no scaling, this caused the plug-in window to be very large for large
layers.
GTK_POLICY_EXTERNAL in GTK3 works the same as the GTK2 version of
GTK_POLICY_NEVER, so using it instead fixes the problem.
The default width and height magic numbers were also replaced with
constants.
2024-01-14 19:43:32 +00:00
sonia 9f762f5e4b plug-ins: Fix JPEG2000 warning
Removes duplicate parenthesis in the CMYK color space check.
2024-01-14 11:17:29 -05:00
Alx Sa c01ffee74f plug-ins, libgimpconfig: Fix minor warnings
- file-psd, sig[4] and block_len variables are initialized to stop uninitialized warnings
- file-xpm, g_file_peek_path () is cast to (char *) to stop "discarded const" warnings
- gimpconfig-serialized.c, %llu is used instead of %lu to stop overflow warning
2024-01-14 14:30:32 +00:00
Anders Jonsson ad123bbbc4 plug-ins: mark svg, wmf dialogs as translatable 2024-01-11 18:45:40 +01:00
Alx Sa 1666f82b20 scripts: Partially fix spinning-globe.scm
During the API port, the Map Object
plugin had some parameters added and
others changed to GimpChoice strings.
This broke the Spinning Globe filter which
called on the map-object plugin.
This patch updates the procedure call and
fixes ranges in the map-object plugin so
spinning-globe works again,
but larger scope warnings persist.
2024-01-11 03:20:04 +00:00
bootchk 96afe1532d libgimp: Refactor fractal-explorer-dialogs.c: extract methods
No functional change.

I did this while chasing #10590 and #10591
The refactoring moves replicated code into functions.
So readers can understand better without having to compare sections
of replicated code.
The comments also highlight issue #10590.
2024-01-09 19:21:27 +00:00
bootchk d26433036c Fix #10536 Plugins: Fractal Explorer fails
Use g_connect_signal_swapped for "resource-set" signal from Resource Choosers,
to match the signal handler expecting "callback data" in the first arg.
Otherwise the first arg is the object emitting the signal.
2024-01-09 19:21:27 +00:00
Alx Sa bbbf6df52d plug-ins: Fix image-map grid type change
Resolves #10611.

In GTK3, GtkRadioButtons are set using the "active" property
rather than selected, so the callback needed to check the
GTK_STATE_FLAG_ACTIVE flag instead of GTK_STATE_FLAG_SELECTED
when changing grid types.
The code was also reformatted to match current coding style.
2024-01-09 02:54:09 +00:00
Jacob Boerema 45ea994e89 plug-ins: improve default color handling of foggify
- To set color values in the 0-255 range we now have to use set_uchar.
- Because setting a default color is not working, the color in config
  could be None, which if the color wasn't changed caused a CRITICAL.

Let's check for None and if that is the case then manually set our
default color.
2024-01-08 18:11:46 -05:00
Jacob Boerema c44819f58b plug-ins: fix foggify AttributeError on Cancel
When cancelling foggify we get the following error:
AttributeError: 'GimpProcedureConfig-python-fu-foggify' object has no
attribute 'end_run'

The end_run function was removed a while ago, so just remove this line.
2024-01-08 18:11:46 -05:00
Jacob Boerema 129667423f plug-ins: fix #10587 image map crash in grid menu
The grid state was not correctly updated when changed from within the
grid settings dialog.

Instead of using g_simple_action_set_enabled we need to use
g_simple_action_set_state, since we don't want to change whether the
action is enabled or disabled, but the checked/unchecked state.
2024-01-07 17:52:44 -05:00
Alx Sa f66c6e9681 python: Use theme colors for console font color
Previously, the console's font color was hardcoded to #006000.
This did not stand out well on darker theme.
This patch pulls the widget's foreground color from GtkStyleContext
to ensure it contrasts sufficiently with the console background color.
2024-01-04 17:51:02 +00:00
Bruno Lopes d5f41b296b build/windows, data, extensions, plug-ins: Fix Build omissions
- Fix "no icons" errors generating loaders.cache with .cmd (CI-Cross).
  ! This is a sub-optimal fix, but it's better than a useless build.

- Fix "no interpreter" errors generating .interp with Meson (CI-Native)
  and generating .interp and copying .typelib with .cmd (Local-Native).
  ! This is a sub-optimal fix to Local-Native, but plug-ins will work.

- Fix "no iso" error copying iso_639.xml with Meson (Local-Native).
2024-01-02 10:49:31 +00:00
Anders Jonsson a4d309c7f7 plug-ins: more consistent ellipsis usage 2024-01-02 03:43:34 +00:00
Anders Jonsson e4e3dcca6b plug-ins: readd translation context for tag values
Originally added in 55aa462faa
2023-12-31 13:14:00 +00:00
Alx Sa a331e91309 plug-ins: Fix Fractal Explorer blue inversion
Resolves #10537.

During the port, the "green_invert" variable
was repeated twice rather than using the
"blue_invert" variable. This prevented the
fractal from updating when blue was changed.
2023-12-28 22:59:46 +00:00
Jacob Boerema ec2ee8fe91 plug-ins: fix #10498 Incorrect layer order when loading certain PSD's
Our handling of Photoshop's Blend Clipped Layers as Group is flawed
causing the order of layers to be messed up which may cause certain
parts of the image to become invisible or having the wrong colors.

This only fixes the incorrect layer ordering. Correct handling of
group layers with clipping needs a more extensive rewrite.
2023-12-26 11:39:49 -05:00
Jacob Boerema 2945fa6db2 plug-ins: more detailed PSD export compatibility notice
Follow up to the previous commit, we clarify the compatibility issue
between using legacy layer modes and Clip to Backdrop.
2023-12-26 11:39:48 -05:00
Jacob Boerema f8bdca24aa Revert plug-ins: fix bad parsing of PSD blending modes
This is a manual revert of eac1df4b61
since other changes were made to the same lines.

Although using legacy layer modes for several blend modes improves
compatibility with Photoshop, we found out during testing of the
image from issue #10498, that it negatively impacts loading of PSD's
that use Blend Clipped Layers as Group.
We convert this specific PSD setting by adding a layer group and
setting Composite Mode to Blend to Background.
However, our legacy layer modes do not support Composite Mode, meaning
that PSD's using this can show up using smeared colors.

Since this hasn't been in a release yet, let's revert this and rethink
how we want to handle the combination of these PSD settings.
2023-12-26 11:39:48 -05:00
Alx Sa dd10433c37 plug-ins: Fix indexed transparent PNG export
Resolves #9933.

We used png_get_valid (pp, info, PNG_INFO_tRNS) to check if
an indexed PNG had transparency when exporting.
However, this function does not return TRUE/FALSE but instead
the contents of that PNG chunk. Since we use index 0 for transparency,
this function always returns 0. The non-transparent indexed export code
ran regardless, creating incorrect PNGs.
We set pngg.has_trns earlier if the image has transparency, so it's safer
to use this variable instead.
2023-12-23 21:40:14 +00:00
bootchk 11b7e4cded Fix #10511 ScriptFu CRITICAL on scripts with no dialog, e.g. Reverse Layers
Magic number 1 changed to 2 in one place. Missed in earlier fix for #10127.

Changed magic number to a defined macro constant so it might not happen again,
should GimpConfig change again.
2023-12-22 09:43:01 -05:00
bootchk 507cbdc44a Fix #10508 ScriptFu CRITICAL on invalid resource ID
Add test case test/PDB/resource.scm
2023-12-20 12:50:02 +00:00
bootchk b1f2f71113 Fix #10465 ScriptFu marshal color strings correctly
Fix test case.
2023-12-19 18:40:48 +00:00
Anders Jonsson 37c971c08e app, plug-ins: make missing tooltips translatable 2023-12-19 17:56:30 +00:00
bootchk 555afe2058 Fix #10188 SF marshall array of super Item instead of subclass Drawable
Substantive change is call gimp_item_get_by_id instead of gimp_drawable...
And a few type changes from GimpDrawable* to GObject*.

Lots of renaming of functions, substituting "item" for "drawable."

Update comments.

Made one function static that was already private.

Fix the test case gimp_vectors_set_selected
2023-12-19 09:55:21 -05:00
bootchk 5486e4094a Enhance tests of PDB in ScriptFu
Add more tests

Enhance testing framework, add function assert-PDB-true

Enhance some tests: make test files order independent

Fix tests broken by recent changes to GIMP
2023-12-19 06:47:36 -05:00
Anders Jonsson 88c7520451 ScriptFu: make default names translatable 2023-12-17 03:02:25 +00:00
Anders Jonsson c64d59b80c plug-ins: make pdf export strings translatable 2023-12-17 03:02:25 +00:00
Bruno Lopes 276754e9fe plug-ins: update Compatibility Notice wording
Since we now have documented certainty which modes are compatible, the
Compatibility Notice should convey more reassurance.
2023-12-13 17:58:37 +00:00
Bruno Lopes e494c2ea71 plug-ins: update the PSD table of inaccurate/non-exact modes
Some 2.10 modes, even in perceptual space, don't produce the same
result as PS. Now, the mapping table takes this into account, which
avoids surprises for the user.
2023-12-13 17:58:37 +00:00
Bruno Lopes eac1df4b61 plug-ins: fix bad parsing of PSD blending modes
The mapping table was generically indicating 2.10 modes as first choice,
which was resulting in terrible PSD compatibility in some cases. This
commit fixes this using legacy modes verified with latest PS version
(see attached files in MR).
2023-12-13 17:58:37 +00:00
Anders Jonsson bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Stayd 594afaf900 plug-ins: DDS import rewrite
Comprehensive rewrite of the DDS import routine, in the interest of
easier maintainability and readability. Adds formats.c/h, containing
tables and functions related to reading and parsing uncompressed files.
Importer now supports nearly all non-video uncompressed formats.

Includes a variety of minor-to-moderate fixes made along the way
which could not be pulled out into separate commits due to dependence
on other aspects of the rewrite.
2023-12-13 03:30:48 +00:00
Stayd 829a92d62e plug-ins: Update dds.h and add known format codes
Minor cleanup and updating of types to GIMP types.
Addition of more known DXGI format codes, and one flag used by NVTT.
2023-12-13 03:30:48 +00:00
bootchk 77c12a205b Add tests of PDB procedures gimp-image-set-selected-layer etc. 2023-12-11 18:42:59 +00:00
bootchk 1ccceccb01 Fix #10460 2023-12-11 15:09:07 +00:00
Anders Jonsson dbfd506df4 plug-ins: string fixes for lighting plug-in 2023-12-10 21:39:13 +01:00
Alx Sa e317166c98 plug-ins: Fix defaults of secondary light points
Resolves #10454.
When porting to GimpProcedureConfig, all
light types were set to "Point" when 2 - 6
should have been "None" by default.
This patch fixes the defaults.
2023-12-10 14:57:56 +00:00
bootchk dd2d0c96bf Fix a test plugin.
1. Recent changes to arg validation reveal bug in call to gimp-drawable-edit-gradient-fill,
supersampling arg must be >0

2. Make easier for testers to invoke by reducing the declared drawable capability
to SF-ONE-OR-MORE-DRAWABLE
2023-12-10 06:03:15 -05:00
bootchk 4d4639b8f3 Fix scripts calling obsolete gimp-brush-delete
Now use gimp-resource-delete

Drive-by fix of bad call to gimp-context-set-pattern.

Fixes other calls to gimp-font-delete, etc. in a test script.

Partly fixes 9867.
2023-12-09 11:23:58 -05:00
Jacob Boerema adb8f9dcbf plug-ins: fix #10429 Online help not opening
We were using an incorrect parameter name for calling the online help.
Instead of domain-names it is url.
2023-12-03 10:12:55 -05:00
Stayd b8834a9596 Always interpret BC1 cutout pixels as black
Per the official format specification and hardware implementation,
BC1 cutout pixels are always black with 0 alpha, whereas previous
versions of the plugin interpreted them as white. Commit f97e718e
partially fixed this, but made the behavior an import option that
also ignored the alpha component. This commit reverts the addition
of this option in favor of consistently following the spec.
2023-12-01 20:42:16 +00:00
Stayd eb5a9576c6 Updated save-type and mipmaps props to GimpChoice
The export properties "save-type" and "mipmaps" were left as ints
in Commit 427130be due to uncertainty on whether options could be
conditionally disabled on GimpChoice properties. From testing it
this functionality appears to work fine and is used in other plugins.
Now all combo props are GimpChoices and fully configurable from dds.c
2023-12-01 20:42:16 +00:00
Stayd a5d1d96a38 Consolidate YCoCg/AlphaExp code, always decode
Moves most of the code relating to YCoCg and Alpha Exponent into
misc.c/h, in the interest of making the rest of the codebase cleaner.
Removes the decode option from the import menu, as encoded files are
always decoded now (there used to be a menu button for doing this
after import, but with it gone there's no reason ever to not decode).
Finally, the remaining functions in color.c were only ever called once,
so these were extracted and inlined, and the empty file deleted.
2023-12-01 20:42:16 +00:00
Stayd 30922cc266 Better handling of DX10+ files in ddsread
Partial refactor of parts of ddsread to better handle DX10+ files.
Though not included here, this is necessary to import formats that
have no DX9 equivalent, namely BC6H and BC7, as the current handling
simply downgrades DX10 files and imports them like DX9 ones.
2023-12-01 20:42:16 +00:00
Stayd e9c301cb37 ddsread and ddswrite cleanup and commenting
Extensive formatting and cleanup in the read-write files, and addition
of some comments where they seemed appropriate. Renamed a couple of
single-letter variables to be more descriptive.
Also removed an unnecessary global variable in ddswrite.c, and made
the "config" variable in ddsread a GimpProcedureConfig type, as was
previously done for ddswrite.
2023-12-01 20:42:16 +00:00
Stayd 4eea8ab42e Mipmap generation fixes and cleanup
Fixes two major issues with mipmap generation, namely sRGB transforms
being applied both backwards and in 8-bit precision, causing severe
color degradation. sRGB transforms are now handled correctly and all
mipmap generation is done at 32-bit floating-point precision.
A new cubic filter has also been added (Catmull-Rom) which rounds-out
the existing lineup of cubic filters.

Also includes extensive code cleanup (sorry I couldn't separate this)
to mipmap.c/h and color.c/h
2023-12-01 20:42:16 +00:00
Jacob Boerema c2ecf37923 script-fu: fix #10279 gimp-image-set-selected-layers is failing
Recently some extra input validation was added, which caused the
gimp-image-set-selected-layers command in script-fu to fail with an
invalid value for argument 2.

This is caused by the object array contents always being set as
GIMP_TYPE_DRAWABLE, while the actual type may be a layer, etc.

So, let's set the actual type of drawable being used here by using
G_OBJECT_TYPE on the first data element.
2023-12-01 15:28:57 -05:00