Commit Graph

9910 Commits

Author SHA1 Message Date
Bruno Lopes 184e2704a4 build/windows: Add MS Store dist script
Adds PowerShell script and proper manifest for making .msixupload
(only for releases) and/or .msixbundle (always, for testing).

As authorized by Jehan, 32-bit willn't be supported. The reasons are:
1. 32-bit is going to die when WIA plug-in is done. This can hurt reviews
2. 32-bit is being restricted in ARM64 version. This causes disparity
3. 32-bit is generating a big footprint. "This is bad for the environment"
   To be clear: we are discarding most of 32-bit artifact (see point 1)
   and what could not (TWAIN for x64 only, point 2) almost doubles .msix.

There is one small circumstantial reason too:
4. 32-bit wouldn't have .pdb even after GCC 14 because bins have same name
   as x64, and MS don't allow multiarch debug symbols in the same .appxsym
2024-04-21 18:12:38 -03:00
Jehan c65aca8b17 plug-ins: rename various '*-save.[ch]' files to '*-export.[ch]'.
Though it's not visible and could happily wait for after GIMP 3 release, this
was annoying when grepping. Just did a quick cleanup.

I also removed gimprc.common which is a forgotten remnant from the autotools
build.
2024-04-21 16:48:58 +02:00
Alx Sa 32d64ab1c9 core, widgets: Convert HSV/A to float
Per Pippin, the only color model that can
have double precision is RGB/A.
Therefore, we need to switch all others to
use float instead. This patch converts the
HSV and HSVA double babl formats.
2024-04-21 03:42:27 +00:00
Jehan b31a465a9e plug-ins: port ifs-compose to GeglColor. 2024-04-20 20:04:32 +02:00
bootchk 2914fd40ff ScriptFu: Test: maintenance, fix tests broken by changes to Gimp, add tests.
Fix tests broken by changes to gimp_data, wilber.png=>gimp-logo.png

Uncomment failing tests whose issue was fixed.

Remove calls to deprecated functions.

Make more test files use v3 binding script-fu-use-v3

Compare floats relatively by epsilon.

Add some missing tests.
2024-04-20 08:25:35 -04:00
Alx Sa a0d040bddc libgimp: GimpSaveProcedure to GimpExportProcedure
This patch continues porting save API to
export for the 3.0 release.
2024-04-20 07:50:42 -04:00
Jehan 106d18605a libgimpcolor, app: gimp_color_parse_(css|hex|name)() renamed with _substring() suffix.
New functions with the same name as these functions are created, except without
the length argument (i.e. it's equivalent to calling these with -1).

The reason for this is that using strings with a length variant which may be
negative to switch to NUL-terminated strings are not bindable. At least in our
case, when testing in Python, the input string ended up as corrupted garbage and
GObject Introspection docs warns about such interfaces:

> In particular, avoid functions taking a const char * with a signed length that
> can be set to a negative value to let the function compute the string length
> in bytes. These functions are hard to bind, and require manual overrides.

(see: https://gi.readthedocs.io/en/latest/writingbindableapis.html#strings)

So instead, I create a simple version which runs on NUL-terminated strings only
and which is bound, whereas unbinding the generic length-version (making it
C-only, or maybe usable in some other bindings which ignore the (skip)
annotation; apparently some do this).
2024-04-20 12:37:20 +02:00
Jehan d51cde85c1 plug-ins: script-fu is now GimpRGB-free. 2024-04-20 12:06:41 +02:00
Jehan fde0b27754 plug-ins: add missing include.
This fixes:

> plug-ins/script-fu/script-fu-refresh.c:70:1: warning: no previous declaration for ‘script_fu_register_refresh_procedure’ [-Wmissing-declarations]
2024-04-19 23:58:18 +02:00
Jehan 2b27feb2fd app, libgimp*, modules, pdb, plug-ins: new GimpParamColor.
This is meant to obsolete GeglParamColor with at least an additional argument
has_alpha which we need in GIMP. It allows to advertize when a parameter wants
an opaque color, which in particular means we know when displaying a GUI to pick
colors with alpha or not.
2024-04-19 23:25:13 +02:00
Jehan a50759cda8 app, libgimp*, pdb, plug-ins: remove GimpRGB support in GIMP protocol.
There are no plug-ins which uses GimpRGB for procedure argument, nor is there
any base PDB procedure. We don't pass this type anymore through from/to
core/plug-ins. So let's clean the whole code out as a next step to get rid of
GimpRGB from our codebase!
2024-04-19 14:34:22 +02:00
Anders Jonsson 70b8e49e01 script-fu: fix calls to gimp-context-set-[pattern/brush]
Like in e31de151fa
these now need to work on an object rather than a name.
2024-04-19 12:37:45 +02:00
Alx Sa e31de151fa scripts: Use GimpFont object in Render Font Map
Resolves #11354

Due to improvements in the text API, we have to pass a GimpFont
object as the last parameter of gimp-text-get-extents-font rather
than just a String.
2024-04-18 23:06:31 +00:00
Jacob Boerema a367dec2f8 plug-ins: fix #10787 Page Setup warning/critical
When closing the Page Setup dialog we had warnings and criticals in
the terminal.
The cause for this was that we were looking for the temp procedure
to notify the print plug-in. However, this temp procedure is only
installed if the print plug-in is running, not when running the
Page Setup directly, in which case it is not needed.

We now check if the procedure is valid (meaning the print plug-in is
running) before calling the temp notify procedure.
2024-04-18 12:43:08 -04:00
Alx Sa ad5e612a1c plug-ins: Fix palette_sort after GeglColorPort
Resolves #11324

Similar to 403af188, we needed to update function calls
that assumed they were receiving a GimpRGB struct rather
than a GeglColor object. Future plans including adding Gegl
functions to retrieve HSV and HSL automatically, rather than
using gegl_color_get_bytes().
2024-04-18 15:42:27 +00:00
Jehan 2434c41a12 app, plug-ins: renaming the `file-*-save-internal` procs to `file-*-export-internal`. 2024-04-18 16:02:00 +02:00
Jehan 9f149ef3a2 app, libgimp*, plug-ins: get rid of GimpRGB arrays now that we have GeglColor arrays. 2024-04-18 16:00:42 +02:00
Anders Jonsson 2e536b6df1 plug-ins: change file-[gbr/gih/pat]-save to export
Fixes some scripts, followup to
c92cf7e8f2
2024-04-18 12:28:53 +00:00
Alx Sa 403af1880f plug-ins: Fix GeglColor port of palette-offset
Removes an index that was needed to GimpRGB, but no longer
valid now that gimp_palette_entry_get_color () returns a GeglColor
object. Also, fixed an issue in Interactive Mode where the first
valid palette would be used for every other attempt, no matter which
palette you clicked on.
2024-04-18 04:02:48 +00:00
Jacob Boerema 204bc9390e plug-ins: compose needs to add .xcf filename extension
We are using `gimp_image_set_file` to set the filename, which
requires an extension, not doing so caused an error.
So let's add .xcf to all compose filenames.
2024-04-17 16:58:27 -04:00
Jacob Boerema 4aa3e7a475 plug-ins: fix #3480 decompose extension needs to be .xcf
When decomposing, the plug-in sets the filename without changing the
extension. However, gimp_image_set_file requires the filename to be
an .xcf file.

To fix this we simplified `generate_filename` to always add an
.xcf extension.
While doing this we also fixed a critical that happened when no
filename was set (new image), by testing `gimp_image_get_file` for
being NULL first.
When no filename was set it also didn't use the type when
config_as_layers was set, this is also fixed.
2024-04-17 16:58:27 -04:00
Jacob Boerema f574dc7f0f plug-ins: add missing error message when TWAIN driver isn't found
There was no user feedback when our twain plug-in couldn't find the
(32-bit) TWAIN driver, making for a poor user experience.

Especially since nowadays the availability of the twain driver is
less likely, let's add an error message for the user, so they will
know what's going on.
2024-04-16 15:09:49 -04:00
Jehan a78c41d2a3 meson: on macOS temporarily update rpath to find libraries of non-installed GIMP.
The DYLD_LIBRARY_PATH trick was working fine on CI, but not on local builds for
Lukas. Apparently there are security measures disabling the environment
variable. Instead let's temporarily add then remove libgimp libraries folders
from rpath.

See: https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/merge_requests/292#note_2075291
2024-04-16 17:43:15 +00:00
Alx Sa c92cf7e8f2 plug-ins: Convert file_*_save to file_*_export
Resolves #10932

Since GIMP distinguishes between saving
XCF and exporting image like PNG,
we should change the PDB to show
export rather than save in the function
calls.
2024-04-16 16:07:10 +00:00
Alx Sa 5b5a8f58e4 python: Fix ColorXHTML export
Since the GeglColor port, gimp_drawable_get_pixel () returns
a GeglColor rather than a GimpRGB structure. We needed to
update the supporting code in ColorXHTML to handle the change.
2024-04-16 01:57:01 +00:00
Anders Jonsson bca4679fa3 python: fix translation of Spyrograph dropdowns 2024-04-15 23:19:02 +00: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
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
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
Anders Jonsson 3f0120578d plug-ins: fix duplicate Brightness labels in Flame 2024-04-13 14:37:19 +00: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
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
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
bootchk 9a2de135ee ScriptFu: fix #10698 and other issues with script progress
Fix unreported issue that new-style dialog using GimpProcedureDialog
does not display progress.

Change progress reporting to use app's status bar, for all scripts,
old and new style.
As before, report progress whenever a script calls a PDB procedure,
by putting the procedure name in the status bar.

Eliminate progress bar widget from old-style script dialog.
Since it was failing on Wayland, and since it is inconsitent
with new style dialog using GimpProcedureDialog.
2024-04-08 11:27:13 -04:00
Alx Sa 23807a3aa3 plug-ins: Port sparkle to GeglColor
Also remove one instance of GimpRGB in
cml-explorer. The remainder requires a
different approach to optimize the filter.
2024-04-07 23:17:12 +00:00
bootchk 2df7874216 ScriptFu: hide "Refresh Scripts"
It is broken and throws critical, see #10596.

Expedient to hide it instead of fixing it, to not block 3.0rc1.

As discussed in #10652, a user can simply restart GIMP instead.
"Refresh Scripts" is a poor design, a bandaid.
There are plans for better alternatives to install/remove scripts.

The MR for #10652 shows the reason it throws critical,
and could fix it,
but completing the MR requires time we don't have.
Note the MR is not on these files, but on core plugin machinery.

The change is to extract functions to a separate file,
and still build them, but not call them or link them.
They also are not translated while not being called.

Eventually, the extracted files can be deleted (or restored when they work.)
There is other related cruft that needs deletion in scheme-wrapper.c.
2024-04-06 14:33:13 -04:00
bootchk 0b9ec0e8b9 ScriptFu: TinyScheme: add call-with-output-string etc to dialect
Add canonical/idiomatic functions call-with-output-string,
call-with-input-string, any->string to the library init.scm.
Since they are useful, especially in test scripts and frameworks.

Remove their definitions from test scripts and test frameworks.

Also comment out failing test in test script string-escape.scm.
2024-04-06 13:43:33 +00:00
bootchk bf59bf026b ScriptFu: TinyScheme: revise tests of byte operations
Redefine call-with-output-string etc. in the test script: test9.scm
Other fixes to the test script.

Improve logging of no memory condition for string-ports

Fix bug freeing ports that have been closed.
When ports are closed, string-port code was treating them as string-ports.
2024-04-06 13:43:33 +00:00
bootchk d8e5d694d3 ScriptFu: TinyScheme: major revision and fix bugs string-port
Fix #11040 and #9495 bugs with unicode in string-ports

Fix other unreported bugs with allocations and garbage collection of string-ports.

Obsolete open-input-output-string, a string port of kind input-ouput is no longer supported
and the function actually opens a string-port of kind input which cannot be written.

Comments and Gimp style in the original TinyScheme code, now in string-port.c

Revise tests of string-port.

Update TinyScheme README: Discuss more thoroughly the ancestry, and changes from upstream.
2024-04-06 13:43:33 +00:00
bootchk b32be06502 ScriptFu: TinyScheme: refactor string-port
Extract pseudo class string-port methods to separate file.

No functional changes intended.

Style changes not complete: anticipate further bug fixes and styling.
2024-04-06 13:43:33 +00:00
bootchk 96da006e4a ScriptFu: TinyScheme: delete unused functions for string-ports 2024-04-06 13:43:33 +00:00
Anders Jonsson 134c354a9e app, pdb, plug-ins: lower Spread limit for Distort
Distort can call plug-in-spread with Spread of 1000 which causes an error.
This limits it to 512 which is the highest allowed by gegl:noise-spread
2024-04-04 12:04:12 +00:00
Alx Sa 99e0446dfd libgimpcolor: Port gimp_cairo_checkerboard_create ()...
to GeglColor.
2024-03-31 01:09:45 +00:00
Alx Sa 2cfe12deab plug-ins: Port file-xmc to GimpSaveProcedureDialog 2024-03-30 02:01:20 +00:00
bootchk 1e104769d7 ScriptFu: tests of TinyScheme string-ports and string escapes
Add document about string-like objects in TinyScheme.

Add tests of several outstanding issues in TinyScheme.
In preparation for fixing them.
2024-03-29 10:03:44 +00:00