Commit Graph

9429 Commits

Author SHA1 Message Date
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