Commit Graph

9574 Commits

Author SHA1 Message Date
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
Zander Brown e00f2b3bf9 play: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown ddd1a48825 remap: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown efabebd0bb help-browser: move menu to XML 2023-08-10 12:11:01 +00:00
Zander Brown 7d1eac18ca ifs: move menu to XML
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9776
2023-08-10 12:11:01 +00:00
Alx Sa 8709e91999 plug-ins: Make GFig menus translatable
Based on the IMAP port in !1031, this moves the menu code to a separate file
so that gettext can access it for translation.
2023-08-09 16:17:00 +00:00
Zander Brown 3b6ea6f02e imap: generate sources
The targets were just being left floating, and the pre-generated in-tree
source were always used instead

When bison/flex are found, ensure we actually dep on their output - thus
actually running the targets - and only use the in-tree copies as a
fallback
2023-08-09 13:46:56 +00:00
Zander Brown 637385c7d1 imap: move menu to XML
Having it as an inline string doesn't make much sense, and makes it
untranslatable
2023-08-09 13:46:56 +00:00
Jacob Boerema eee763b1c1 plug-ins: fix #9816 file-raw-data.exe Crash
When changing the width we got a division by zero crash because we
did not consider the case of bpp * bitspp being less than 8.

To fix this we check if bitspp is less than 8 and in that case multiply
the amount of bytes by 8 and then divide by the number of bits per
pixel.
2023-07-31 13:58:26 -04:00
Alx Sa 4b54ceb023 plug-ins: Fix lava filter for non-square selections
Resolves issue #9809, fix by @mareroqpoland.
When "Separate Layer" is selected, the entire drawable is always
filled rather than using the selection. This patch uses the selection
instead (which will be "all" if there is no active selection)
2023-07-30 22:24:49 +00:00
Alx Sa f947109f92 build: Enable IFF format on Windows
Now that libiff and libilbm have been added to the MSYS2 repositories,
the plug-in can be built automatically on Windows.
2023-07-26 17:12:35 -04:00
Anders Jonsson 8b84c5551b plug-ins: add and correct gettext macros in Python 2023-07-25 21:26:57 +00:00
Jacob Boerema 18408ce966 app, libgimp, libgimpwidgets, plug-ins, etc: rename behaviour to behavior
We use US English which uses behavior. So we replace all occurrences of
behaviour.

Most notable is File Open behavior in preferences. Besides that several
mentions in function documentation and a few in comments.
2023-07-21 15:35:23 -04:00
Alx Sa d1864866ee plug-ins: Support Farbfeld image import/export 2023-07-19 00:37:54 +00:00
Anders Jonsson 091893ddf5 menus, plug-ins: more tab menu translatability 2023-07-17 10:27:30 +00:00
Anders Jonsson caff1e61e4 libgimpwidgets, plug-ins: translate dialog buttons
GTK no longer contains stock labels, so the button
labels needed to be marked as translatable.
2023-07-15 14:29:14 +00:00
Alx Sa 9c87aaeebd scripts: Fix warning in Java map tooltip text
Per @ajonsson, gettext does not like < or > used as symbols
and throws a warning. They are replaced with HTML entities
&lt; and &gt; to prevent the problem.
2023-07-15 14:23:01 +00:00
Jehan 3b05315754 plug-ins: fix the Python test dialog.
With recent changes, a GimpResource's ID is not its name anymore.
2023-07-14 16:59:46 +02:00