In file-psd, make the data_start and data_len fields of the
PSDimageres and PSDlayerres structs unsigned, to avoid potential
overflow/sign-extension.
(cherry picked from commit be7cace74e)
Add new Symbolic-High-Contrast and Symbolic-Inverted-High-Contrast
themes, which are automatically-generated high-contrast variants of
the (original) Symbolic theme. The contrast factor is settable in
the makefile, and is currently at 1.5 for both themes.
Rename tools/invert-svg to tools/svg-contrast, which now takes a
contrast-factor argument, and adjusts the input SVG contrast,
instead of just inverting it. Note that we can still use the tool
to invert icons, using a contrast of -1.
I didn't realize it because the meson build was returning 'windows' for
GIMP_BUILD_PLATFORM when I cross-built with Mingw-w64. But in the
autotools, it was storing "mingw32", which would not compare with our
gimp_versions.json. Therefore in GIMP 2.10.16, the version update check
would have worked, but not the revision check.
This fixes the problem.
(cherry picked from commit a5ea6d6b9b)
Allow horizontal scrollbars in all the Preferences dialog tree-
views, so that they don't limit the minimal width of the dialog (in
particular, the UI- and icon-theme tree-views may contain
arbitrarily-long paths).
(cherry picked from commit d868247fd9)
In GimpFgBgEditor, we currently use gtk_render_frame() in master,
and gtk_paint_shadow() in gimp-2-10, to draw a border around the
color FG/BG color areas. However, the former is relatively
subtle, especially with dark themes, and the latter is a NOP with
the pixmap engine, which is what our built-in themes use.
Instead, draw the border ourselves as a pair of black and white
rectangles, similarly to Photoshop.
Move the entire color-frame drawing functionality to a separate
function, to avoid code duplication between the FG and BG frames.
(cherry picked from commit fb1c086097)
In xcf_load_image(), suspend size updates for layer groups before
adding their sublayers, to avoid unnecessary intermediary size
updates. Resume size updates in reverse order, so that nested
groups are updated before their ancestors, after all layers have
been loaded.
(cherry picked from commit 63df5602a2)
... causing artifacts
In GimpGroupLayer, override GimpLayer::get_bounding_box() to return
the group's own calculated bounding box for pass-through groups,
instead of using the group graph's bounding box, as calculated by
the default implementation of GimpDrawable::get_bounding_box().
We don't currently update the group's bounding box in response to
all the events that may affect the graph's bounding box, which can
lead to artifacts, neither should we use the graph's bounding box
anyway, since it includes the backdrop's bounding box, as the
group's layers are composited against the background.
Note that we still use the graph's bounding box for non-pass-
through groups, since it takes attached filters into account,
which are applicable for normal groups, but not pass-through
groups.
Additionally, don't restrict the group's bounding when it has a
mask, since this is now handled by GimpLayer.
(cherry picked from commit aa9ae1c65c)
In gimp_layer_get_bounding_box(), return the mask bounding box when
show-mask is active, and otherwise delegate the actual layer
bounding box calculation to a new GimpLayer::get_bounding_box()
function, and intersect its result with the mask bounding box, if
necessary. The default GimpLayer::get_bounding_box()
implementation simply chains up to
GimpDrawable::get_bounding_box(), but GimpGroupLayer will override
this function in the following commits.
(cherry picked from commit 7f53cf9c55)
In GimpLayer, update the effective mode, and excludes-backdrop,
when any of the mask-related properties change, and, when show-mask
is active, set the effective mode to NORMAL.
(cherry picked from commit b2a1a7cb01)
In GimpOperationLayerMode, when the op has a mask connected, and
we're processing an area outside the mask bounds, set the op's
opacity to 0, so that the backdrop shows through. The actual
process() function gets a NULL mask pointer in this case, and so
would composite the layer as if it had no mask, exposing areas that
should be masked out.
Add a GimpOperationLayerMode::parent_process() function, which
subclasses can override instead of GeglOperation::process(), and
make sure to update the GimpOperationLayerMode::opacity field
before calling this function (and, subsequently, before calling
GimpOperationLayerMode::process()).
Clean up the rest of the fields, and adjust the rest of the code.
(cherry picked from commit 646c804c04)
In GimpPaintTool, when not snapping brush outline to stroke, make
sure to properly snap the cursor position to 15-degree angle
multiples in line mode, not only when painting the line, but also
during motion.
(cherry picked from commit 0f07f1baa5)
In gimp_drawable_merge_filter(), fix the format of newly allocated
buffers when applying a filter that changes the size of the
drawable, and the requested format is either unspecified, or
matches the existing drawable format. The new buffer would
previously be created with a "RGBA float" format in this case,
regardless of the image precision, resulting in a potential
mismatch between the drawable format and the image precision.
This cna lead to inconsistent buffer data when saved as XCF, which
is later rejected on load. See issue #4643.
(cherry picked from commit ae6f6ba42a)
When dropping a corrupted layer while loading an XCF, make sure to
clear the corresponding XcfInfo fields that point to it, so that
it's not erroneously used later, as we now continue loading the
image even after corrupted layers are encountered.
See, for example, issue #4643, for a corrputed XCF file affected by
this.
(cherry picked from commit d53e701daa)
In gimp:replace, when compositing the same content over itself,
i.e., when the input and aux buffers share the same storage and
same tile alignment, pass the input buffer directly as output,
instead of doing actual processing.
In particular, this happens when processing a pass-through group
outside of its actual bounds.
(cherry picked from commit 2eaaa950a5)