The code to ban some filters for non-destructive usage was duplicated in
a PDB file and in the XCF load code. Additionally to combining these 2
codes into a single gimp_gegl_op_nde_allowed(), this commit also moves
part of the logic into gimp_gegl_op_blacklisted() which improves the
following:
* It used to be possible to create filters for hidden operations which
were not returned by gimp_drawable_filter_operation_get_available(),
such as "gegl:color" or "gimp:equalize", which would create all sorts
of problems. Now trying to create these filters through the API will
not work and will properly warn with an explicit error message.
I do not consider this an API break since the filters were not
returned in the available lists and therefore were not considered
usable. Anyone who would have used any of these hidden filters was
just going around a weakness in our implementation.
* We make sure that our lists of allowed/forbidden filters are
consistent across usages.
* When getting the list of filters with gimp_gegl_get_op_classes(), we
don't need to do an additional validation step (as we were doing until
now in the PDB call). This is meant to imply that all returned
operations were already validated.
This fixes Spyro Plus not running interactively after commit a7f02d4ee1.
Note that this seems to be the only plug-in which got broken by this
commit AFAICS.
This operation cannot be run from the public API right now because it
requires the "histogram" argument whose type is currently unknown to
libgimp/PDB.
Furthermore even if we were to add this type, there are some fundamental
issues with this op which makes it unsuitable (for now) as a
non-destructive filter:
1. Since the histogram is computed only once at op construction, it
wouldn't be rebuilt when the source buffer changes.
2. Using gimp_drawable_calculate_histogram() doesn't build from the
source buffer of the node anyway, but from the drawable buffer. This
would mean a broken histogram as soon as the filter is inserted in
the middle of other filters (anywhere but in the bottom).
We will need to fix these 2 points to consider using this as NDE (and
therefore also make it available in the API).
The trc variable could be initialized by the "trc" property, but even
though this is processed inside GimpOperationPointFilter code, the
property is only set in some of the child classes (such as Curves or
Levels). As a consequence, this was left unitialized and even actually
used in other child operations (unless they overrode prepare()). This
was the case of GimpOperationEqualize which was always working in
linear mode since GIMP 3.0 (see #14486).
Since uninitialized variables may end up as 0, which would have been
GIMP_TRC_LINEAR enum case anyway, this probably doesn't really change
the behavior. This is not guaranteed by C, but IIRC GObject zero-ed
object structs. Yet it is always better to be explicit.
In GIMP 2.10, gimp_histogram_new () takes a boolean
parameter to indicate if it should be rendered in a linear
or non-linear TRC. In GIMP 3.0, this function instead takes
a GimpTRCType where 0 is equal to the linear enum and 1
is equal to the non-linear enum.
Since gimp_drawable_equalize () still passes FALSE as it
did in 2.10, this is treated as 0 and thus setting it as a linear
operation.
This patch changes the FALSE to be GIMP_TRC_NON_LINEAR,
both for clarify and to better match the 2.10 behavior.
In the path tool, when setting a new vector layer as
the editable path, we try to disconnect the old signal for
gimp_path_tool_vector_layer_path_changed () from the
vector layer options. However, if this code is triggered
because we rasterized the vector layer while the path
tool was active, it will throw a warning because the
layer options are NULL. This patch adds a check to make
sure the options exist before trying to disconnect their
"notify::path" signal.
When copying and pasting vector layers, if we needed
to add a new path then the layer was not redrawn.
This would require the user to move or edit the path
to see the correct view of it.
This patch adds a call to gimp_vector_layer_refresh ()
after pasting it if it is not rasterized, in order to correct
the initial view.
When copying and pasting a vector layer into
another image, the display would jump back to
the original image. This also happened if you
re-selected the pasted vector layer in the new
image after choosing another layer.
This patch makes sure that when updating the
selected path in the Path tool, it grabs the display
from the pasted vector layer rather than the old
image's path.
Note that this may be a "symptom" rather than a
root cause, due to a number of remaining issues
with copying and pasting vector layers.
The Canvas Size dialogue and the default options
for it in the Preferences dialogue were listed in
opposite order. This patch puts them in the same
order as the Canvas Size dialogue (Fill with, then
Resize Layers) to keep them consistent.
The create guides dialog of the imagemap plug-in shows up very wide
due to the hint text not being wrapped.
To fix this we enclose the hint box inside a scrolled window and set
horizontal policy to GTK_POLICY_EXTERNAL and a minimum vertical size
of 100, based on how we do this in the export procedure dialog for
the comment field.
This patch adds a CSS class name to
GimpPivotSelector so we can define its
CSS style in the GUI.
It also defines the margin-right CSS property
to prevent it be affected by the general
GimpOverlayDialog style.
Our export dialog resizes the width of the dialog based on the size
of the longest comment line. Apparently certain programs save data
that can be very long. On Windows I did not experience a crash, but
the dialog is many screens wide and unusable in that state.
To fix this we change the horizontal scroll policy to
GTK_POLICY_EXTERNAL because GTK_POLICY_NEVER apparently stops GTK
from resizing the window at a reasonable size.
We also set wrap mode of the comment field to GTK_WRAP_WORD_CHAR
to make sure the lines that consist of only numbers without spaces
get wrapped at a reasonable length.
When we switched the NDE popover to use
GimpRow instead of GtkTreeView, it inherited
the `list row` style which is inverted in comparison.
This resulted in the "selected" filter looking like an
unselected row and vice versa.
This patch adds a more specific version of the theme
to GimpRow when it exists in the NDE popover widget,
to prevent this confusion.
This fixes this unharmful message we were getting on macOS CI:
Gdk-WARNING **: 18:06:23.048: Failed to initialize CVDisplayLink!
The hard ones (spyro-plus.py, histogram-export.py and python-console.py)
were not touched for now, just the ProcedureDialog plugins were fixed.
This patch adds a parasite on load that retains
the original import settings of a DDS
texture (such as compression, number of mipmaps,
and flags). This parasite is then checked on export,
and if it exists, we default the compression
format to the original to reduce the chance
the user will choose the wrong format for
the game they're creating the texture for.
The other data stored is not currently used,
but can be implemented in future commits.
Current version had a cropped software name in it. This is a further
improvement on gimp-data#16, adding also some layer choice (otherwise we
are stuck just moving the crop window away, never able to get a possible
beautiful crop under the software name).
This was failing our build when -Dwindows-installer=true thanks to
integrity rules. Note that there is no iso-639 gettext module for kw, so
I found the "Kernewek" translation with Wikipedia.
There is no Inno code module that I could find.
Fixes:
> Error: languages listed in iso_639_custom.xml do not match the .po files in po/.
> - Faulting 'dl_code' on iso_639_custom.xml: kw
Applies f78a0629 and b420a773 logic to
gimp_image_get_thumbnail () so it
converts higher bit-depth images to 8 bits
for GdkPixBuf.
This affects plug-ins like GFig which use
a full image preview, as well as thumbnail
metadata exports and image combobox
previews.
We use Richard Geldreich's bc7enc_rdo
library to minimize the code changes required
in the existing DDS plug-in, and so it can
more easily be swapped out in the future.
When we export paths in GIMP, we escape the <title>
text to ensure it matches the SVG specification.
On import, we were not unescaping the text. This resulted
in changed path names when copying and pasting within
GIMP itself.
This patch adds a call to g_uri_unescape_string () to convert
the escaped text back to its original format.
Per user request, this allows you to use
arrow keys to adjust the shear tool.
Left/right move the shear on the X axis,
up/down move the shear on the Y axis.
By default, it moves one pixel at a time.
If you hold shift (similar to the move
tool), it moves based on the slider's
page increment setting (factoring in the
current zoom).
Too much RUN calls are not efficient. First, VFS uses a lot of IO at each RUN;
second, each RUN is cached as layer (we had more than one hundred layer tags!).
(Not that this does not apply to Dockerfile2 which uses no layers.)