Commit Graph

9604 Commits

Author SHA1 Message Date
Jehan f5001a4c8c plug-ins: we must output the dummy file in the same directory. 2023-06-29 00:09:28 +02:00
Jehan 9e9fe1435a build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.

There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).

Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.

This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 17:46:46 +02:00
Daniel Novomeský a4f0239818 plug-ins: support libjxl v0.9 decoding API 2023-06-26 16:41:05 +02:00
Jehan 6a9838c804 plug-ins: fix build warnings.
Fixes several missing declaration warnings because in fact of missing include,
such as:

> warning: no previous declaration for ‘console_editor_new’ [-Wmissing-declarations]

Fixes 2 old-style definitions:

> warning: old-style function definition [-Wold-style-definition]
2023-06-25 23:43:40 +02:00
bootchk 7b9b5db69e SF Console history persist as GStrv setting.
Other driveby format and wording changes to dialog title, welcome text.

Part of issue 9579 SF roadmap
2023-06-25 18:28:03 +00:00
Alx Sa 280cde75f4 plug-ins: Port checkerboard to...
...GimpProcedureDialog
2023-06-23 14:13:29 +00:00
Jehan a580f47e22 plug-ins: fix previous commit (!901).
Config string properties are allocated. We can't use static strings.

Also fixing an unused variable (mesg_body) warning.
2023-06-21 21:38:36 +02:00
Alx Sa 51cf74c036 plug-ins: Port mail to GimpProcedureDialog 2023-06-21 19:36:28 +00:00
Alx Sa e152591e80 plug-ins: Don't run Depth-Merge when cancelled.
When porting depth-merge to GimpPlugin in 5154b271 the return statements
were not fully replicated. As a result, the depth-merge function was 
called even if the dialogue had been cancelled.
This patch adds the missing return statements to prevent this.
2023-06-21 19:01:32 +00:00
Jehan 2541389b0c plug-ins: don't use a hardcoded 256 as max border.
Half of the smaller dimension seem a better value, since once we reach any half,
it means we will compute using all pixels anyway. Any width higher than this is
useless.
2023-06-21 17:33:04 +02:00
Alx Sa 519b627f5d plug-ins: Port border-average to...
...GimpProcedureDialog.
Also provides an example of the new 
gimp_procedure_dialog_get_size_entry () API.
2023-06-21 14:05:19 +00:00
bootchk 57909356ff Implement #9628 enhanced err msg for mismatched parens 2023-06-20 07:39:26 -04:00
bootchk 1bc2ed77a3 Fix #9554 (quit 1) must yield err msg
So that scripts have a way to declare an error.
2023-06-20 11:14:13 +00:00
Jordi Mas a09609bb76 Removes spaces at the end of string and Compuserve company name which is not relevant in 2023 2023-06-19 20:47:51 +00:00
Alx Sa 762088f9de plug-ins: Show dimensions, BPP in ICO layer names 2023-06-18 05:11:44 +00:00
Alx Sa 2065db7fe7 plug-ins: Don't load image for ICO thumbnail
Due to a small typo, GIMP always loaded the entire image as a thumbnail
even if a suitable one was found.
This patch fixes that typo.
2023-06-17 04:42:34 +00:00
Alx Sa e5a4336604 plug-ins: Add width/height label to ICO export
Similar to the ICNS export, file-ico now shows the icon dimensions for 
all types in the export dialogue.
2023-06-16 23:44:36 +00:00
Alx Sa 9efc552069 plug-ins: Keep GIF's full palette on import
Resolves #414.
Currently GIMP only loads the palette colors used in a GIF, discarding 
the rest. This can cause issues when a consistent palette is required
(e.g. a video game sprite or background).
This patch uses either the global or local GIF max palette value to set 
the colormap size, thus retaining the full palette on import.
2023-06-15 21:07:22 +00:00
bootchk 5eac31f07f Refactor ScriptFu Console
Rename fields of ConsoleInterface more desciptive

Add c,h files for object editor and history

Extract object ConsoleEditor

Extract object ConsoleHistory

Extract TotalHistory methods
2023-06-15 13:26:00 +00:00
Øyvind Kolås 21411047ee app,pdb,plug-ins: %s/gegl_node_connect_to/gegl_node_connect/ 2023-06-13 19:58:42 +02:00
Øyvind Kolås 6919d07b6c plugins/file-gegl: use gegl_node_link instad of gegl_node_connect_to 2023-06-13 17:14:03 +02:00
Alx Sa a04f287a4b script-fu: Fixed SF_ONE_OR_MORE_DRAWABLE option
The order of GIMP_PROCEDURE_SENSITIVE_DRAWABLE | 
GIMP_PROCEDURE_SENSITIVE_DRAWABLES was reversed in 
gimp_procedure_set_sensitivity_mask (), which caused scripts using 
SF_ONE_OR_MORE_DRAWABLE to crash.
2023-06-13 02:51:58 +00:00
Alx Sa 73d5dcecae plug-ins: Fix defaults for 1/4/8 bpp ICO export
8bpp and below ICO formats use a 1 bit mask for transparency.
When imported the mask is treated as an additional transparent color.
If the icon used the max palette (e.g. 2 colors for a 1bit icon),
the default export format will become larger than necessary.
This checks if the layer still has 1 bit alpha, and subtracts the
mask color from the count.
2023-06-09 22:12:43 +00:00
Jehan c9b114e6e9 plug-ins: we still depends on librsvg 2.40.x.
In commits a6756b515b and 23da44e3c8, newer API of librsvg were used, over our
current minimum requirement. The reason why we don't bump this requirement is
that librsvg 2.40.x are the latest versions which are full-C. While we have
nothing against Rust, it is not available on all existing platforms, and we
really want to have GIMP buildable everywhere, while also have SVG support
always present (even though it's a vector format, it's an important one in
graphics work nowadays).
See issue #6821.

So in the end, let's keep the old minimum requirement, but test against librsvg
version to compiler either with old API or new one. The changes are limited
enough that it's not too much a bother.
2023-06-08 17:43:16 +02:00
Alx Sa 5070e0e9ec plug-ins: Add additional DigitalSourceType...
types for the metadata editor.
2023-05-31 18:06:39 +00:00
Michael Natterer 5acdaac8e0 libgimp: remove getters and setters from GimpResourceSelectButton subclasses 2023-05-31 17:18:19 +02:00
Michael Natterer 9638102418 Introduce a global ID space for GimpData/GimpResource objects
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.

	modified:   libgimp/gimpplugin-private.h
2023-05-31 16:12:04 +02:00
Jacob Boerema 7908ecfbcd plug-ins: synchronize name of nl-filter with manual
The name of the nl-filter plug-in in the manual was recently changed to be
more in line with its description.
Since that is already the name of the plug-in file here, let's also update
the name of PLUG_IN_PROC to be in line with this.
2023-05-27 23:12:11 -04:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Niels De Graef 85a77f8a64 plug-ins/grid: Make sure dest_buffer is initialized
Initialize to NULL at the very least
2023-05-26 12:45:50 +02:00
Jacob Boerema 671996e897 plug-ins: fix #8441 distress-selection.scm script failure
distress-selection.scm uses gimp-image-set-active-channel which has been
removed causing script failure when a channel is selected instead of a
layer.

Use the new multi-layer aware gimp-image-set-selected-channels and also
use the gimp-item-id-is-* functions instead of the deprecated
gimp-item-is-* functions.
2023-05-25 18:31:56 -04:00
Niels De Graef 01e960e98e plug-ins/scheme-wrapper: Use GIR for enum values
This allows our script-fu plugins to use the GIMP enum values, just like
all our other plug-ins know them.

In other words:

* Names are consistent with those of other plug-ins
* Introspectable enums are automatically added as they are added to the
  introspection file, without even needing a recompile
* No need to keep track of our enum types anymore, as that is just a
  redundant implementation of introspection in practice. This in turn
  will let us simplify some of the pdb code
2023-05-24 23:19:20 +02:00
Michael Natterer a8d30578cd script-fu: fix double free in script-fu-dialog.c
Spotted by Lloyd Konneker.
2023-05-24 21:35:48 +02:00
Alx Sa 7a1e6bedd5 plug-ins: Increase Script-fu Console size...
and Plug-in/Procedure Browser size.
gtk_widget_set_size_request () is applied to the dialog, as it does not
seem to bubble up from being applied to individual elements.
The existing 2.10 width/height values are used.
2023-05-24 18:56:23 +00:00
Michael Natterer 4fb27afd9e plug-ins: don't leak the comment string in file-psp.c 2023-05-24 14:32:00 +02:00
Simon Budig f540e79172 screenshot: there actually is no need to preprocess the PNG data... 2023-05-24 11:32:05 +02:00
Niels De Graef 89c359ce47 Remove GimpUint8Array in favor of GBytes
GLib has a specific type for byte arrays: `GBytes` (and it's underlying
GType `G_TYPE_BYTES`).

By using this type, we can avoid having a `GimpUint8Array` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GBytes`, we allow other languages to pass on byte arrays as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with byte arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2023-05-23 23:37:50 +02:00
Simon Budig 23da44e3c8 file-svg: remove deprecated librsvg api, added some pixbuf/cairo fuckery. 2023-05-23 00:45:50 +02:00
Simon Budig 3b925cd78e animation-play: remove deprecated gtk-alignmnents 2023-05-22 22:35:30 +02:00
Alx Sa 3cd896c983 plug-ins: Import IBM PC Formatted TIFF layers
TIFFs with PSD layers can be saved in either Macintosh or IBM PC format.
IBM PC section labels are reversed and the integers are Little Endian.
We now check for 'MIB8' sections and reverse the necessary values so
that the PSD plug-in functions can handle them.
2023-05-22 14:45:34 +00:00
Simon Budig a6756b515b file-svg: fix deprecated use of rsvg_handle_get_dimensions() 2023-05-22 09:30:25 +02:00
Alx Sa 6f8f481ee2 plug-ins: Remove screenshot-icon.h in Makefile.am
Since the file itself was removed in 5d7d11a8.
2023-05-22 04:29:56 +00:00
Michael Natterer 7de9c347b6 script-fu: use gimp_value_array_copy(), and free the copy 2023-05-21 18:56:32 +02:00
Alx Sa e020a6b3ca plug-ins: Add support ILBM HAM mode images
"Hold and Modify" ILBM images use control bits to increase the palette
beyond what's stored in the CMAP chunk. This patch checks if
HAM mode is set and then interprets the plane bits accordingly.
2023-05-21 15:31:42 +00:00
Simon Budig 5d7d11a81f screenshot: move deprecated pixdata into png resource 2023-05-21 13:22:57 +02:00
Simon Budig 7f10328777 script-fu-dialog: fix memleak 2023-05-20 23:41:18 +02:00
Simon Budig 51311f913d metadata: shut up a weird warning 2023-05-20 23:32:18 +02:00
Simon Budig d16734a4e4 plug-ins: fix some glib related deprecations 2023-05-20 21:46:17 +02:00
Simon Budig a2458f1528 file-tiff-load: fix mismatching variable type 2023-05-20 18:47:14 +02:00
Jacob Boerema b37f0a3182 libgimp, plug-ins: remove obsolete XmpStructs 2023-05-20 12:39:29 -04:00
Alx Sa 604045fc0f plug-ins: Replace deprecated GdkColor with GdkRGBA
As GdkRGBA stores colors as doubles rather than guint16, the assignment
code had to be moved into the ifdef block as well.
Note that this code is only used if X11 is not available on build.
2023-05-20 15:17:14 +00:00
Alx Sa 24a1d34bba plug-ins: Porting to GimpSaveProcedureDialog
These five plug-ins already used GimpProcedureDialog when I originally
worked on them for !9250. However, their export GUI needs to
use GimpSaveProcedureDialog instead.
2023-05-20 14:30:41 +00:00
Simon Budig b5f6c2e855 Revert "script-fu: resolve some duplicate menu path entries"
I had a bogus installation. Sorry for that.

This reverts commit c0691ea85c.
2023-05-20 01:31:47 +02:00
Simon Budig c0691ea85c script-fu: resolve some duplicate menu path entries 2023-05-20 01:17:39 +02:00
Jehan 3862fad8c1 plug-ins: file-fits becomes an optional plug-in.
Let's make cfitsio an optional dependency, showing up in the final configure
output. The file-fits plug-in will just not be built when the dep is missing.
2023-05-15 12:20:53 +02:00
Alx Sa d4f420769c plug-ins: Port FITS plug-in to cfitsio library
Switch to NASA-maintained cfitsio library for loading/exporting FITS images.
This allows us to import compressed FITS files (GZIP, HCOMP, PLIO, RICE) in
8/16/32 bit and float/double precision. It also simplifies export code using
the built-in cfitsio APIs.
2023-05-14 15:05:50 +00:00
Jacob Boerema 1fa8e8617b plug-ins: fix previous metadata-editor commit
- Missed a necessary autotools change: forgot to remove ui/Makefile
from configure.ac
- Not all compilers allow declaring variables in a case statement without
putting them in a block, so we add a block now.
2023-05-10 14:28:42 -04:00
Jacob Boerema 8969bbcee8 plug-ins: Remove dependency on GtkBuilder from metadata-editor
Instead of loading the GtkBuilder .ui file we now create all widgets in
code.
Added several support functions to reduce code copy/pasting and making
additional widgets and supporting more metadata easier.
The overall layout should still look the same, with a few exceptions:
- Each notebook page only uses one grid. This makes it possible to align
all data entry widgets.
- Featured Organization and it's code were two treeviews next to each
other. These are now organized below each other to make automatic code
generation easier.
- Since we needed to touch this code anyway, I also fixed Xmp.dc.creator
and Xmp.iptcExt.ModelAge to be multiline. This closes #7286.
- The old icons used for the date button, add, and remove row buttons
were replaced by gimp-grid, list-add and list-remove.

Since this was the last .ui file used in GIMP plug-ins, we remove all
files from the .ui subdirectory and references to that.

Note that there are several more places where GtkBuilder is used, but
those cases uses strings defined in code instead of .ui files.
2023-05-10 13:25:12 -04:00
Jacob Boerema 415b32e763 plug-ins: refactor set_tag_string usage in metadata-editor
We had a lot of duplicate code using gexiv2_metadata_try_set_tag_string
and then checking for errors.

Simplify this by re-using the existing set_tag_string function by
introducing an extra parameter that tells us whether or not to clear
the tag first.
2023-05-10 12:48:01 -04:00
Tomasz Golinski 5337070bf2 plug-ins: remove obsolete check for Babl fish in file-psd.c
It was a temporary code added before relevant code landed in babl. The necessary merge request landed in Babl some time ago, and Gimp now requires Babl version 0.1.98, which includes the needed commit.

Related to merge_requests/509
2023-05-07 14:21:17 +02:00
Alx Sa c085d94777 plug-ins: Swap deprecated gexiv2 functions in...
...file-tiff-save. As in a57a62ce, this updates
`gexiv2_metadata_clear_tag ()' to `gexiv2_metadata_try_clear_tag ()`.
2023-05-04 16:38:23 +00:00
Jacob Boerema a57a62ce1a plug-ins: replace deprecated gexiv2 functions in metadata-editor
In the master branch we depend on gexiv2 0.14, so we can remove the
deprecated functions and replace them with the "try_" versions.

We can't backport this, since our stable branch has a lower dependency
for gexiv2.
2023-05-01 19:01:13 -04:00
Jacob Boerema 58e02b4f4e plug-ins: Reimplement date picker in metadata-editor without GtkBuilder
Also changes the dialog title to not have a ':' and make the title
express what the expected action is.
2023-05-01 19:01:13 -04:00
Alx Sa 78a72c89ac plug-ins: Port file-ps to use GimpProcedureConfig
This ports the Import and export dialogs to use GimpProcedureConfig.
It covers all properties except GUI-only options
(which were still ported to libgimpui rather than direct GTK calls)

Additionally, a warning was fixed and mnemonics were added to the
property titles.
2023-05-01 07:15:42 -04:00
Jacob Boerema 9c11b40393 plug-ins: create metadata-viewer gui from code
The metadata-viewer uses a GtkBuilder .ui file to create the interface.
In GIMP we prefer our interfaces to be created in code and these builder
files are also not available anymore in GTK4.

This commit removes the .ui file and support code, and creates the
interface from code in our plug-in.
2023-04-30 16:01:40 -04:00
Alx Sa 5526bebf3c plug-ins: image_id used rather than image in print
In 2.10, print_temp_proc_name () took in the image id. When it was 
updated to take in GimpImage, it still assumed the g_strdup_printf
parameter was an integer.
This is fixed by calling `gimp_image_get_id ()` on the image parameter.
2023-04-30 13:53:16 +00:00
Jacob Boerema d73bae0c66 plug-ins: add support for 8bpp with 4 planes in PCX/DC import
While testing the DCX import MR I saw that one image (abaddon.dcx) was not
recognized. This image uses 4 planes with 8 bpp while we only support
3 planes. The 4 planes type includes an alpha channel.

A few small changes allow us to also load 4 planes by allowing 3 or 4
planes instead of only 3.
2023-04-26 17:27:14 -04:00
Alx Sa 6af7b2f5cb plug-ins: Display warning for unsupported metadata
This allows file-psd-load-metadata to show a warning message like the
PSD plug-in does when unsupported features are loaded.
As PSD metadata does not store rasterized versions of fill layers,
a new option is added to show these layers are dropped entirely unlike
with PSDs.
The dialog title changes based on which plug-in called it.
2023-04-26 12:26:31 +00:00
Alx Sa b5f80f7a14 plug-ins: Load PSD metadata in JPEG plug-in
This adds the PSD metadata plug-in procedure call to the JPEG
plug-in, as part of implementing issue #7549.
Also implements the import half of issue #1842.
JPEGs only store image-level metadata like paths.
2023-04-26 12:26:31 +00:00
Alx Sa 7b6d229be8 plug-ins: Load PSD metadata in TIFF plug-in
This adds the PSD metadata plug-in procedure call to the TIFF
plug-ins, as part of implementing issue #7549.
Also implements the import part of issue #2921.
TIFFs can have both image and layer-level metadata.
The load_paths() function was removed, as the PSD plug-in should
handle this now.
2023-04-26 12:26:31 +00:00
Alx Sa b788513bcc plug-ins: Add method to load external PSD metadata
Creates a new public procedure that can be used by JPEG/TIFF files to
load any PSD-formatted metadata they have. This consolidates code
to the PSD plug-in, and lets JPEG/TIFF get immediate updates as the
PSD plug-in improves its own metadata support.
Note that only Macintosh formatted metadata is currently supported
by the PSD plug-in; IBM PC formatted metadata is reversed and not
yet interpreted.
2023-04-26 12:26:31 +00:00
Alx Sa da217088d0 plug-ins: Fix rounding error in PCX load
Some valid PCX/DCX files wouldn't load because the bytes per line
header check can be off by one due to integer division rounding.
This adds 1 to the equation to account for this.
2023-04-23 17:37:45 +00:00
Alx Sa 7bc7273d04 plug-ins: Add support for importing DCX files
DCX files are containers that store up to 1023 PCX files.
The PCX plug-in is rearranged to allow reading multiple PCX images per
file, rather than assuming there's only one image.
2023-04-23 17:37:45 +00:00
Alx Sa 73242fe96a plug-ins: Port file-gif-save to...
...GimpSaveProcedureDialog
2023-04-23 17:35:52 +00:00
Alx Sa 222bef78c7 plug-ins: Initial support for Amiga IFF/ILBM
Imports indexed ILBM, Amiga PBM, and ACBM images.
2023-04-22 21:33:27 -04:00
Jehan 1584a9ba50 plug-ins: fix the thread rendering the thumbnails all the time.
After testing a bit more, I realized that the thread was constantly re-rendering
the thumbnails, even though I didn't touch the "white-background"
button/argument.
This was not just a completely invisible problem, it actually affected the page
selection (it was very hard to select pages by clicking on them, it was randomly
working, and more often not selecting anything). This is how I realized there
was a problem.

The reason was simply that I was never actually calling g_cond_wait() because of
a first_loop flag I forgot to set.

Note that docs of g_cond_wait() explains that it is possible that "spurious
wakeup" happen. At first I thought I had this issue, which is why this commit
also adds a boolean flag to check after a wakeup, to make sure that I was in the
"condition met" case and not the "spurious wakeup" one.
Even though I realized afterwards the real reason was much more stupid, I still
left this additional check.

Fortunately this issue doesn't seem to affect the 2.10 code. Or to be more
accurate: the continuous render very likely happens there too, yet it doesn't
break page selection interaction with GTK+2 as far as I can see.
2023-04-22 01:29:42 +02:00
Jehan 179ff7ff4d plug-ins: option to choose whether loading a PDF with white background.
Port commit 41f40f530a from gimp-2-10 branch to the main branch:

    While at first, the idea of always loading PDF with transparency seemed good
    (commit 7aff7e9c70), I realized that a lot of administrative PDF (generated with
    text and vector graphics, rather than scans or alike containing raster) actually
    have transparency. So now all these documents load with transparent background.
    Clearly all the office software are assuming that PDF readers will fill the
    background with white.

    So add a checkbox to decide whether or not to fill the image with white. I don't
    update the PDB procedure. I'll just do this on the main dev branch (while also
    updating a bit the code to newer API).

    Fortunately I regularly open such PDF documents with GIMP and could witness this
    no-transparency expectation before we released GIMP 2.10.34! 😅

As side changes, I also:

* ported file-pdf-load to work with GimpProcedureConfig arguments instead of
  GimpValueArray;
* ported the dialog to GimpProcedureDialog and generating as much of it as
  possible (except for the page selector/preview, and resolution entries);
* renamed the "pdf-password" argument to "password";
* added the "target", "antialias" and "white-background" procedure arguments.

A few issues which would deserve to be looked at more closely in the future:

* adding "width" and "height" arguments and decide how to handle "resolution";
  this will likely be better handled with a new GimpVectorLoadProcedure subclass
  to support vector formats in particular;
* shouldn't page selection be handled in a better way? Probably this could be
  handled by adding a generic logic in GimpLoadProcedure (as multi-page support
  is a common feature across image formats);
* GimpInt32Array arguments ("pages") can't be stored anyway right now.
* the "target" arg should be an enum.
2023-04-22 00:24:24 +02:00
Alx Sa 66716e4d04 plug-ins: Port file-xbm to GimpSaveProcedureDialog 2023-04-19 12:32:06 +00:00
Alx Sa 88a674c80a plug-ins: Port file-html-table to...
...GimpSaveProcedureDialog
2023-04-16 16:38:17 +00:00
Alx Sa 70578378dd plug-ins: Port file-mng to GimpSaveProcedureDialog 2023-04-15 23:13:04 +00:00
Anders Jonsson 9d175f681a plug-ins: fix typos in sparkle 2023-04-14 10:54:05 +00:00
Alx Sa 82a4f568d4 plug-ins: Port sparkle to GimpProcedureDialog 2023-04-14 04:23:11 +00:00
Alx Sa fe9b13f43c plug-ins: Update GimpPreview format in despeckle 2023-04-14 02:25:36 +00:00
Jehan ff684fbeb4 plug-ins: remove "Animators" placeholder from script-fu scripts. 2023-04-12 22:07:09 +02:00
Jehan 6ecfc4a77b plug-ins: more placeholders removed from menu paths. 2023-04-12 22:07:08 +02:00
Jehan c8a2f77c98 plug-ins: don't use "Send" placeholder either. 2023-04-12 22:07:08 +02:00
Jehan 9eea95255a plug-ins: remove the "Acquire" of the menu path.
This is a placeholder which is not meant to appear in the menu. Our new system
uses placeholders internally, but plug-ins cannot make use of these.

Not sure anyway if this is so useful in the cases of plug-ins. At least, I don't
feel it is for these particular use cases.
2023-04-12 22:07:08 +02:00
Alx Sa 5112394636 Issue #9340: Make To/From property less ambiguous
Translators noted these might be confused with To/From fields in email.
Revising labels to match load dialogue UIs.
2023-04-11 16:59:45 +00:00
Alx Sa 4828970fa8 plug-ins: Restore original preview when disabled
I noticed after porting the last few plug-ins that GimpPreview went
to black when you unchecked the auto-preview option.
These widgets must be added directly to the dialogue rather than via the
new API in order for the unfiltered image drawable to be loaded
properly. They will eventually be removed in favor of on-canvas preview,
but let's get them working correctly for now.
2023-04-09 12:19:24 +00:00
Alx Sa 37e114612c plug-ins: Port destripe to GimpProcedureDialog. 2023-04-09 11:49:13 +00:00
Alx Sa d171355703 plug-ins: Port nl-filter to GimpProcedureDialog 2023-04-09 02:13:46 +00:00
Alx Sa cefb9c92ea plug-ins: Port jigsaw to GimpProcedureDialog 2023-04-08 15:34:29 +00:00
Alx Sa 651bda7728 plug-ins: Port contrast-retinex to...
...GimpProcedureDialog
2023-04-07 16:30:38 +00:00
Alx Sa c2b1ce5030 plug-ins: Port blinds to GimpProcedureDialog.
Also, update despeckle to close config when cancelled.
2023-04-07 04:06:59 +00:00
Alx Sa 2368add7e7 plug-ins: Port despeckle widgets to use...
...GimpProcedureDialog APIs.
Adaptive and Recursive checkboxes were converted to a combobox since
they affect one property.
2023-04-07 00:18:51 +00:00
Alx Sa e6a679f233 plug-ins: Port bmp-save widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
Minor typos in the original descriptions were also fixed.
2023-04-05 17:43:23 +00:00
Alx Sa a148b56779 plug-ins: Port file-aa to GimpSaveProcedureDialog 2023-04-05 02:05:33 +00:00
Jacob Boerema 2894b2191d plug-ins: fix criticals in scripts with page size == step size
Two of our scripts have a spinbutton step size the same as the page size.
Since page size should be larger than the step size, this causes a
CRITICAL in LibGimpWidgets:
gimp_label_spin_set_increments: assertion 'step < page' failed

We fix this by setting a page size larger than step size in
coffee.scm and tileblur.scm.
2023-04-02 13:09:57 -04:00
Alx Sa ac9f620c2d plug-ins: Port file-gbr, file-psp to new API.
Ports both to use GimpSaveProcedureDialog.
(Note that file-psp's export function is currently unused)
2023-04-02 12:43:50 +00:00
Alx Sa 4e8c7b8e89 plug-ins: Port file-pnm to GimpSaveProcedureDialog 2023-04-02 02:55:17 +00:00
Alx Sa 01e0941dbc plug-ins: Port file-fli to GimpProcedureDialog API
Also, port the save dialog to use GimpSaveProcedureDialog API.
2023-04-02 01:20:09 +00:00
Alx Sa 06ee7a999a plug-ins: Port sgi.c to GimpSaveProcedureDialog 2023-04-01 17:41:51 +00:00
Alx Sa 6ce835b9d7 plug-ins: Port DDS load dialog widgets to use...
GimpProcedureDialog APIs. Also add mnemonics.
2023-04-01 02:03:55 +00:00
Alx Sa f9eec671a9 plug-ins: Port JPEG2000 to GimpProcedureConfig
This ports the optional load dialogue to use GimpProcedureConfig.
2023-03-31 14:09:48 +00:00
Daniel Novomeský 318148abca plug-ins: fix QOI meson script 2023-03-31 14:15:57 +02:00
Alx Sa 6892ab0530 plug-ins: Add import/export support for QOI file
Allows users to import and export 8 bit, RGB/RGBA Quite Ok Images.
Inspired by Piotr Fusik's work on a plug-in for 2.10.
2023-03-30 18:41:56 +00:00
Alx Sa 958af23775 plug-ins: Restore mnemonics to file-csource 2023-03-30 04:07:33 +00:00
Alx Sa 7f74820b8d plug-ins: Port file-csource to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-30 02:04:00 +00:00
Alx Sa e599a9be59 plug-ins: Add option to override PCX 1 bit palette
If a 1 bit PCX image is opened interactively, a dialogue will let
users choose to either use the built-in palette, or force the colors to
be black/white only. Otherwise, the user can choose this via a script
parameter.
2023-03-27 15:53:05 +00:00
Anders Jonsson 7c4ad8aed7 plug-ins: typo and spacing fixes 2023-03-26 19:20:48 +00:00
Jehan 1d43b65144 plug-ins: fix authorship.
It looks like my commit 3d55452933 broke authorship of the "file-jp2-load"
procedure. This was very likely a copy-paste error.
2023-03-26 19:19:07 +02:00
Alx Sa 054934565f plug-ins: Port file-xpm widget to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 02:19:07 +00:00
Alx Sa dd12d06631 plug-ins: Port file-pat dialog to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 01:56:38 +00:00
Alx Sa 7b5f241591 plug-ins: Add compatibility notice to PSD export
Users have noted that legacy layer modes have better compatibility
when exporting PSDs and reopening them in Photoshop.
This patch adds a notice with that information to the PSD export GUI.
2023-03-25 18:04:42 +00:00
Jacob Boerema 6871a0cfc4 plug-ins: more improvements in file-gif-load
- Use a pre-defined MAXDATABLOCKSIZE for all the buffers filled with
GetDataBlock that is known to be large enough.
- When reading comments ensure that it always ends with a NULL.
- Ensure that the right/bottom frame dimensions are also within range.
2023-03-25 13:37:54 -04:00
Jacob Boerema d86f6a2d6f plug-ins: improve error messages in file-gif-load
Inspired by issue #9195 I went over how we handled error messages when
loading GIF images.
- I replaced some cases with g_set_error and added an error parameter to
ReadImage.
- Introduced function read_error that uses g_set_error when image == NULL,
or else g_message.
- Enabled translations for the messages.
- Synchronized the error messages used to reduce the amount of work for
translators.
- Changed the error code returned internally in a few places, to be better
able to distinguish between encountering and end_code (-2) and possible
corruption errors (-1).
- Moved allocating dest down to not need freeing it in case of error.
- Allow to show partial results in case of errors.
2023-03-25 13:37:54 -04:00
Alx Sa 0dc98936a0 plug-ins: Prevent buffer overflow in ANI metadata
The IART and INAM metadata fields were stored in gchar arrays,
which have a limit of G_MAXSHORT indexes.
However, you can have strings larger than that in the format.
To prevent overflows, they were changed to gchar*. f_read ()'s result
is also checked, and an error is set if it returns 0.
The frame count variable is also now reset per icon block to prevent
overflow as well.
2023-03-24 18:43:13 +00:00
Alx Sa e7695c2b57 plug-ins: Port file-tga widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-23 02:45:55 +00:00
Daniel Novomeský 2e6e5f0321 plug-ins: Port file-heif to GimpProcedureDialog 2023-03-22 20:05:27 +00:00
Alx Sa cc04035a54 plug-ins: Port file-sunras widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-21 18:54:15 +00:00
Alx Sa 0bc38d9df2 plug-ins: Make WebP preset names translatable
Resolves #9252
2023-03-21 00:48:25 +00:00
Alx Sa c034c383c3 plug-ins: Port wavelet decompose in to...
...GimpProcedureConfig.
This ports the main dialogue to use GimpProcedureConfig.
2023-03-20 11:50:25 +00:00
Alx Sa bcce4607c5 plug-ins: Port hot-plug-in to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
2023-03-18 19:27:00 +00:00
Alx Sa bbccf2656a plug-ins: Port align-layers to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
It also adds the GUI-only options to the procedure itself, so that you
can call them via scripts.

Additionally, the layer warning was fixed and 
mnemonics were added to the
property titles.
2023-03-16 00:15:14 -04:00
Alx Sa 0ce773da76 plug-ins: Fix potential crash in PSD CMYK export
@Wormnest notified me of issues with CMYK profiles overwriting existing
ones, and potentially access a dereferenced profile.
This patch adds an additional condition check, and clears out the
profile in addition to dereferencing it.
2023-03-15 00:30:11 +00:00
Alx Sa 6d02eb4505 plug-ins: Recognize https:// in ImageMap plug-in
This adds "https://" as a valid website prefix in the ImageMap URL edit
field, in addition to http://.
It also restores the prefix change that 2.10 had when you switched URL
types. It also fixes code formatting in affected areas.
2023-03-11 21:53:12 +00:00
Anders Jonsson 949c6d43c3 plugins: Remove extra word, spacing 2023-03-04 07:13:52 +01:00
Alx Sa 1d45fc0808 plug-ins: Show unsupported PSD features in GUI
Adds a new PSDSupport struct to keep track of what unsupported features
a PSD contains.
It is then used to conditionally display a compatibility notice
via a GUI.
2023-03-03 02:34:32 +00:00
Alx Sa dbaea2ac50 core: Fix CSS palette import regex
GIMP expects CSS palettes to end with a ";" when importing. However,
GIMP exports CSS lines without ";". This means GIMP can't reopen its
own exported CSS palettes.
The ";" was removed from the regex since CSS2 does not require
the last line to end with a ";". However, CSS3 and above
require ending all lines with a ";", so it is added to the
export script.
2023-02-28 16:00:03 +00:00
Alx Sa 3df39dee91 plug-ins: Re-add toggle behavior from GAction port
When porting IFS-Compose and GFig to GAction, I originally created
all icons as GtkToolButtons. However, the toggle buttons no longer 
appeared "pressed in" when selected.

This is fixed by creating those as GtkToggleToolButtons instead.
A lingering UIManager object was removed from IFS Compose as well.
2023-02-24 03:25:08 +00:00
Alx Sa 5102355ac9 plug-ins: Port ImageMap to GAction/GMenuModel
Additionally, the ImageMap-specific icons weren't showing up due to the
filenames not matching the references strings ("imap-polygon" but
the filename was "imagemap-polygon.png"). This patch fixes that by
renaming the strings to match file name.
Partial code style fixes were made as well; a lot more are needed.
2023-02-16 04:16:11 +00:00
Jacob Boerema 5ef77e6e8e plug-ins: disable magics detection for Windows CUR and ICO files
The magics used for detection for CUR and ICO are not very unique and
interfere with the detection of certain types of TGA images.
Since these TGA images are regularly used, it seems better to only base
CUR and ICO detection on the extension, just as we do with TGA version 1
files.

See also issue #7912
2023-02-14 15:16:15 -05:00
Jacob Boerema 5f9415a641 plug-ins: fix #9067 TGA files saved by Krita can't be opened
Krita had a bug where it incorrectly saved 4 for the alpha bits instead of
8. We will allow 4 and convert that to 8 to be able to read the incorrect
TGA images.

The likelyhood of real TGA images with 4 alphabits seems pretty low, so it
should not interfere with real images that have this set. We were not
supporting that anyway.
2023-02-14 15:16:15 -05:00
Jehan 4f1d0fb53b plug-ins: get rid of various gimp_image_set_file() calls.
- This is unneeded in all import procedures. See previous commit. Note though
  that this is not because of a change in previous commit. This was already
  useless previously. The file set with this PDB function was overridden by the
  core anyway (i.e. even before the previous commits).
  In app/file/file-import.c:file_import_image(), the imported file is correctly
  set (so there is no need to set it from plug-in, which anyway libgimp's
  gimp_image_set_file() was not doing) and the XCF file is reset to NULL
  (rendering the call to gimp_image_set_file() in a GimpLoadProcedure useless).
- Similarly, this is a useless call in export procedures because
  app/file/file-save.c:file_save() overrides such call too. I could only see one
  such case for JPEG export, which was quite useless.
- Finally in other types of plug-ins, setting a non-XCF file extension was
  interfering with the save feature (similarly to commit e6e73e14c7). I only
  fixed the screenshot implementations doing such a thing.
- I left a few usages which will have to be looked at more in details later.
2023-02-13 22:54:16 +01:00
Jehan e6e73e14c7 Issue #8581: forward-porting file-name fix from `gimp-2-10` branch.
This is a port of commit 57ee6e13ab to the main dev branch.
2023-02-13 22:54:01 +01:00
Jehan 851ddad2ee plug-ins: add back the prompt when "clearing" the Python console.
This code is taken from Massimo's comment in #1786 and MR !834. It doesn't fix
a crash as this was already handled in !404, yet the missing prompt after
hitting "clear" was clearly not consistent with how one expect a clear feature
to work.

At least now, we've got a prompt back immediately after clearing.
2023-02-13 13:17:30 +01:00
Jehan c369827725 plug-ins: load PDF without filling the background to white.
Some PDF have transparency on purpose. Filling with white, without any question,
is counter-productive and prevents from working on such PDF files.

Note that we could add an option with a checkbox, leaving one to decide whether
to fill the background or not. But it feels over-engineering the issue. The PDF
is transparent, so that's what we load, and that's it. If one wants to add a
background, it's easy to add a layer at the bottom of the stack (and they can
make it any color they want, not just white), after loading the file.
2023-02-10 19:51:45 +01:00
Alx Sa 8b2262530b plug-ins: Make PDF background color fill optional
This adds a checkbox to single and multi-page PDF export to not fill
transparency with the background color 
(which currently happens automatically)
2023-02-10 18:35:14 +00:00
Jehan fb1f16d4b8 plug-ins: fix a crash in tiff_io_error().
I had a TIFF file which would crash while triggering an error, inside g_logv()
code (and according to the stacktrace, even probably inside some lower level
printf implementation code).

The reason was that I already processed the variable list with
g_strdup_vprintf() and printf didn't like this va_list being reused, then
segfaulted with some "Cannot access memory at address" error.

The alternate fix was to first copy the va_list in the first use with
va_copy()/G_VA_COPY, yet since we already processed the format data, I thought
it was useless to do this. Let's just directly use the formatted string.
2023-02-10 19:28:19 +01:00
Alx Sa 38c031e01d plug-ins: Port GFig to GAction/GMenuModel
Because of how many actions can change the sensitivity of "undo" options
most of the plug-in files had to be edited to pass GimpGfig to them.
2023-02-04 23:16:24 -05:00
Alx Sa 0628db1506 plug-ins: Fix possible crash on ifs-compose load
The build variable in GimpIfs struct is now initialized to NULL to
prevent build issues when finalized.
2023-02-02 14:27:34 -05:00
Alx Sa 78d2e8819b plug-ins: Port IFS Fractal GUI to GAction
Converts the pop-up menu and toolbar. Also replaces deprecated
gtk_arrow_new () with similar GtkImage of an arrow.
2023-02-01 20:26:53 +00:00
Alx Sa c7bef41a1e plug-ins: Add export support for PAM files
Exports the following PAM formats: 
GRAYSCALE, GRAYSCALE_ALPHA, RGB, RGB_ALPHA.
As with import, the main difference is the header and transparency.
Raw PPM export code is reused for the actual data.
2023-01-29 22:09:05 -05:00
Alx Sa af904ec55d plug-ins: Add import support for PAM files
PAM files are essentially PPM files with a different header format and
alpha/16 bit support.
Jörg Walter's 2.2 code was updated and implemented to read the revised
header format. The existing PPM loading code works with PAM files.
2023-01-29 18:01:48 +00:00
Jehan a0e95f6f35 plug-ins: G_APPLICATION_DEFAULT_FLAGS exists since GLib 2.74.
Our current minimum requirement is 2.70.0.
2023-01-29 15:02:11 +01:00
Alx Sa a4f2b06547 plug-ins: Remove GIMP_PROC_ARG_UCHAR parameters
Replaces them with GIMP_PROC_ARG_INT, which will be necessary for a
future INDEXED mode with greater than 256 colors.
2023-01-28 16:19:50 +00:00
Alx Sa 5ac2027285 plug-ins: Port colormap-remap to GAction
Modeled after the animation-play port in 691e0c02
2023-01-28 10:17:33 -05:00
Jehan c1aa1b7b3d plug-ins: fix freeing NULL object.
When the plug-in is queried initially for plug-in setup, then freed, the builder
object is not created.
2023-01-27 14:18:20 +01:00
Jehan bd94175c9a plug-ins: coding-style fixes.
While studying this code as base for the previous commit, I noticed various
coding style issues.
2023-01-27 01:48:33 +01:00
Jehan 691e0c0272 plug-in: port animation-play to GAction.
Largely inspired by commit dddb23c6. This also gave me a good overview of the
various missing features in GAction (compared to GtkAction) and how we'll have
to implement this in GIMP core. I now have a very clear path of what remains to
be done.
2023-01-27 01:48:33 +01:00