Commit Graph

9591 Commits

Author SHA1 Message Date
Jehan 96b3302e65 plug-ins: port gradient-flare to gimp_image_procedure_new2() and GimpProcedureDialog.
The port to GimpProcedureDialog is partial as there are still quite a few pieces
which can be improved. But it's a good start.
2023-10-01 20:52:01 +02:00
Jehan 7da0db9e88 plug-ins: port tile to gimp_image_procedure_new2() and GimpProcedureDialog. 2023-10-01 20:52:01 +02:00
Jehan 3806b46fc5 plug-ins: forgotten Python plug-ins had to be ported to new Gimp.Procedure.new().
There was also one case of port to updated GimpResource API to get the name of a
palette.
2023-10-01 20:52:01 +02:00
Jehan 2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan a2acf24ecb libgimp, plug-ins: Script-fu scripts now use gimp_procedure_new2() too.
Also in gimp_procedure_config_begin_run(), make sure we sync the arguments with
the config object first thing, even in interactive and with-last-vals case
(where the args may be further overridden). This was especially important for
Script-fu scripts as the image and drawable were not provided separately, so we
need to make sure that the config file has the right values.
2023-10-01 20:52:01 +02:00
Jehan 5d3112a2f1 plug-ins, libgimp: move GimpBatchProcedure's run function to use config objects.
Also port more script-fu procedures to gimp_procedure_new2(), which were sharing
some code with the script-fu batch procedure.
2023-10-01 20:52:01 +02:00
Jehan af00b66914 plug-ins: port the easy script-fu procedures to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan 38ecbfc762 plug-ins: more plug-ins ported to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan 9b2240f51e plug-ins: port web-page to GimpProcedureDialog and gimp_procedure_new2().
Again a lot less lines for more functionalities (e.g. now it should work fine in
WITH_LAST_VALS mode).
2023-10-01 20:52:01 +02:00
Jehan e92ef9d45a plug-ins: port several of the easy plug-ins to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan f6da799c11 plug-ins: port screenshot to GimpProcedureDialog and gimp_procedure_new2().
A lot less lines for the same functionalities!
This includes improvements too:

* "include-pointer" as new PDB argument;
* settings storage thanks to GimpProcedureDialog;
* it should hopefully work better in non-interactive (though it's untested).

The macOS and Windows screenshots are untested after this change, though they
should still work the same. Please report if there is any problem!
2023-10-01 20:52:01 +02:00
Alx Sa 6ad54ca3a3 plug-ins: Fix DDS vulnerability (ZDI-CAN-22093)
Resolves #10069

Currently, the DDS header information for the width, height, and bytes per scan line
are read in and assumed to be correct. As these values are used for memory allocation
and reading, it would be good to verify they do not exceed the file size.

This patch adds a condition after the header is read in to verify those values. If they exceed
the file size (mins an offset), the file is not read in and an error message is shown.
2023-10-01 17:06:25 +00:00
Alx Sa 865cc56894 plug-ins: Fix vulnerability in file-psd
Resolves #10101.
This patch adds a missing break statement after an error condition
is detected to prevent the code from continuing afterwards.
2023-09-29 20:38:51 +00:00
bootchk 89901c8466 Fix for 2.99 only #6157
Also refactoring: extract two functions

Add test case scripts/test/register-fail

Catches more registration errors.
Any errors not caught at least will not crash.

Remains to be ported to 2.10, but only a few lines,  without the refactoring.
2023-09-28 13:26:23 +00:00
Jehan 3dcc4196fb plug-ins: plugin-defs.pl also is a remnant from autotools! 2023-09-27 15:57:58 +02:00
Jehan d88f6f9733 app, devel-socs, icons, plug-ins, tools: remove various autotools artifacts.
* generate-icon-makefiles.py was a tool to generate the icon-list.mk files.
* mkgen.pl was used to generate plug-ins/common/Makefile.am
2023-09-27 15:39:39 +02:00
Mark 2e9823f8ea coffee fix 2023-09-26 10:32:55 +00:00
Alx Sa cb352ab5b2 plug-ins: Add Esm Software PIX format import support 2023-09-23 21:26:47 +00:00
Alx Sa 96f536a335 plug-ins: Fix PSP vulnerability (ZDI-CAN-22096)
Resolves #10072.

The current PSP palette loading code does not check if
the file's palette entry count value is below the limit
(G_MAXUNIT32 / 4 due to each color being 4 bytes long).
This patch adds this check and stops loading if the count
is larger than GIMP currently supports.
2023-09-23 15:46:13 -04:00
Alx Sa e1bfd87195 plug-ins: Fix PSP vulnerability (ZDI-CAN-22097)
Resolves #10071.

When reading RLE compressed data, a buffer was allocated to 127 bytes.
However, it can potentially be used to read 128 bytes, leading to a
off-by-one vulnerability. This patch allocates 128 bytes to the buffer
to prevent this from occurring.
2023-09-23 02:16:24 +00:00
Jehan 231ca0c505 Issue #9994: do not call g_file_info_get_is_hidden() (and others) directly.
This is not the main reason for the specific output in #9994. These ones are
more probably because of similar usage in GTK (which updated its own calls to
g_file_info_get_is_hidden|backup() in version 3.24.38). But we should likely
also update the various calls we have to use the generic
g_file_info_get_attribute_*() variants.

To be fair, it is unclear to me when we can be sure that an attribute is set.
For instance, when we call g_file_enumerate_children() or g_file_query_info()
with specific attributes, docs say that it is still possible for these
attributes to not be set. So I assume it means we should never use direct
accessor functions.

The only exception is that I didn't remove usage of g_file_info_get_name(),
since its docs says:

> * Gets a display name for a file. This is guaranteed to always be set.

Even though it also says just after:

> * It is an error to call this if the #GFileInfo does not contain
> * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.

Which is very contradictory. But assuming that this error warning was
over-zealous documentation, I kept the direct accessors since they are supposed
to be slightly more optimized (still according to in-code documentation) so
let's priorize them when we know they are set for sure.
2023-09-19 15:34:48 +02:00
bootchk bfaebccf4e ScriptFu: change binding of resource from string to int
Fix #9991

And change test cases

And fix string-prefix? function in testing framework
2023-09-15 11:02:46 +00:00
bootchk fe0fe3e0bb ScriptFu: extract function marshall_pdb_return
This commit and the ones prior are simple refactoring,
with no intended functional changes.

In anticipation of enhancements 9608 and 8404
which make returned values more scheme like.

Also makes code more readable.
2023-09-12 15:02:15 +00:00
bootchk d3706a62e3 ScriptFu: add function marshal_PDB_return_by_arity 2023-09-12 15:02:15 +00:00
bootchk 1a8bdf1acc ScriptFu: extract function marshal_pdb_return_values (plural) 2023-09-12 15:02:15 +00:00
bootchk 3e0f37d00a ScriptFu: Extract function marshal_returned_PDB_value 2023-09-12 15:02:15 +00:00
bootchk 61c1acbead tinyscheme: enhance: rearrange error msg so error kind is stable prefix
Error kind should be first to read, is most important.

Makes testing error message easier when prefix is stable.
2023-09-06 06:37:29 -04:00
bootchk 14c30f6514 ScriptFu tests: Add some tests and remove hardcoded ID's
Buffer, palette, parasite, unit, context

Also test only a prefix of error message.
2023-09-06 09:53:31 +00:00
Alx Sa 531da1560d Issue #30: Add onClick, accesskey, and tabindex tags to Image Map plug-in 2023-09-02 03:30:35 +00:00
bootchk ddbb34f357 Fix #9660 ScriptFu flaws for atoms of type character, UTF-8 encoded
For characters outside ASCII:

1. repr is wrong in REPL

2. sharp constant #\<codepoint> fails to evaluate

3. sharp constant hex #\x<hexdigits> accepts invalid UTF-8 codepoints

4. a call to error with such a character eats the output string

Also, changed the repr of ASCII control characters (was #\x7)
to their unicode repr (now a box glyph with hex)
2023-08-26 18:46:56 +00:00
bootchk 2f360ddb34 ScriptFu: #9755 Add test framework and tests for TS and PDB
Test framework and tests in Scheme, and portable.

Work in progress.  Expect commits for more tests.

Testing framework is stable, more or less.

Add more tests

Add tests layer and layerMask.

test Item methods

More tests, selection

Test memory, vector in TS.

More tests char functions

sharp expr tests
2023-08-25 21:39:29 +00:00
Sabri Ünal 05b808b095 plug-ins: Mark RAW export dialog related strings translatable
These strings are related to RAW export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal 5725a3593e plug-ins: Mark PDF/PostScript export dialogs related strings translatable
These strings are related to PDF/PostScript export dialogs which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal d4146aba5c plug-ins: Mark TIFF export dialog related strings translatable
These strings are related to TIFF export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal b7ab467cde plug-ins: Mark JPEG export dialog related strings translatable
These strings are related to JPEG export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Alx Sa 0778b95847 plug-ins: Add support to load PSP ICC Profile data 2023-08-25 02:29:51 +00:00
Alx Sa 7a971ede15 scripts: Add Table of Contents to User Manual submenu
Resolves #1040.
Adds a [Table of Contents] link that directs users to
ID "gimp-main", the table of contents page.
2023-08-21 02:10:45 +00:00
bootchk 161644fdbc Delete obsolete scripts from 2.99
Moved to gimp-data-extras repo

    erase-rows fix #9885
    grid-system fix #8464
    select-to-brush fix #9878
    select-to-image
    select-to-pattern

Just deleted:

    script-fu-copy-visible fix #9868
2023-08-20 20:44:04 +00:00
bootchk 109f43750c Fix #9874 SF plugin script-fu-set-cmap.scm
New API for GByte to gimp-image-set-colormap
2023-08-20 20:44:04 +00:00
bootchk 7f3595285d Fix #9873 fix SF plugin ripply-anim.scm
Fix new multilayer API in call to to plug-in-tile
2023-08-20 20:44:04 +00:00
bootchk d934d6d497 Fix #9866 burn-in-anim.scm SF plugin
Fix API change to gimp-image-set-file.
2023-08-20 20:44:04 +00:00
bootchk 8c3d3a5247 Enhance #9532 elide "Script-Fu" from SF plugin dialog title 2023-08-20 20:44:04 +00:00
Alx Sa 0cfdd0a5df plug-ins: Fix crash in Map Palette
Per https://gitlab.gnome.org/GNOME/gimp/-/issues/9875#note_1817995,
the returned value of gimp_context_get_palette () shouldn't be freed in the
calling function.
2023-08-17 11:23:10 +00:00
Jacob Boerema 40b2412fa4 plug-ins: add synchronization with certain Exif tags.
Exif tags Exif.Image.Artist, Exif.Image.ImageDescription, and
Exif.Image.Copyright were not being synchronized with their Xmp and
Iptc.IIM equivalents in the metadata-editor.

This commit adds synchronization of reading and writing of the metadata.

We adjust the struct for equivalent_metadata_tags by removing unused
fields and adding a field that points to the equivalent Exif tag in
a new struct called exif_tag_info.

On loading of the metadata tags we now also check a limited set of
Exif tags. If no value was set yet, we use the Exif value, or else
we check to make sure both had the same value. If not, print a
warning in the terminal.

On saving of metadata, we now also save to the marked Exif tags, or
if the value is NULL, we remove the tag.

In passing, we also fix two memory leaks by freeing with g_strfreev
temporary string lists.
2023-08-14 17:29:44 -04:00
Jacob Boerema 8495dd6eed plug-ins: improve creation date handling in metadata-editor
Dates in Xmp include a time and timezone, so add a default time when
selecting a date since we can't edit time and timezone yet.

So far, we didn't take into account that IPTC-IIM has separate date
and time+timezone values instead of the combined value in XMP for
DateCreated.

When loading DateCreated check if it has the same value as IPTC
values DateCreated and TimeCreated combined. If not, we show a
terminal error and ignore the IPTC values.
If neither Xmp nor Iptc has a DateCreated, then use Exif.Photo.
DateTimeOriginal combined with OffsetTimeOriginal to set an initial
value.

When saving, synchronize with IPTC-IIM by splitting the DateCreated
value in date and time+timezone and save each to the appropriate tag.
Also make sure that for IPTC-IIM the date separator is a '-'.
2023-08-14 16:50:15 -04:00
Jacob Boerema 83294ba4c7 plug-ins: improve spacing in metadata-editor
Adds a bottom margin to the grids because the horizontal scrollbar
was overlapping the bottom-most row of the grid.
Adds wordwrap and left/right margins to multiline text widgets,
mainly to make the text not start right at the edge of the widget.
2023-08-13 15:15:04 -04:00
Jacob Boerema b97f96249a plug-ins: Xmp.plus.ImageSupplierName can only have one value
as used in metadata-editor:
Change from MODE_MULTI to MODE_SINGLE.
2023-08-13 15:15:04 -04:00
Jacob Boerema c633091d54 plug-ins: in metadata-editor use array size constants...
instead of hard-coded numbers.
Also:
- remove unneeded set_tag_string for n_creatorContactInfoTags
- remove now unneeded structs
2023-08-13 15:15:04 -04:00
Jacob Boerema 4e40a3edd2 plug-ins: make mode in metadata-editor an enum
We were using a string for the metadata mode, meaning we had to compare
string values in a lot of places.

We simplify and probably speed-up comparisons here by replacing the
mode string by an enum value.

The only place still needing the string values sometimes is
metadata-impexp.[ch] where we added a conversion table to convert
the mode to a string.
2023-08-13 15:15:03 -04:00
Alx Sa b459ce95bb plug-ins: Handle single-channel OpenEXR with unknown channel names
OpenEXR allows for arbitrary channel names. Instead of failing once the common ones are checked, this patch 
checks the number of channels in the file.
If there is only one channel, it is treated as 
grayscale (similar to OpenImageIO's behavior).
A debug warning with the channel name is also printed.
2023-08-10 19:37:25 +00:00