Commit Graph

9462 Commits

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