Commit Graph

42785 Commits

Author SHA1 Message Date
727b83cbe6 tools: fix windows file handling in gimp-test-clipboard.c
Use g_open() for proper filename encoding and _O_BINARY to avoid line
ending conversions.

(cherry picked from commit a9b36245c9)
2019-06-11 19:33:10 +02:00
bf3ea7539e desktop: give 2.10.12 release date.
Let's make the release happen!

(cherry picked from commit fa6b57cfbd)
2019-06-11 17:33:20 +02:00
0667fd27c6 Issue #3493: GIMP changes R-channel, when it should not.
Our TIFF loading code was not taking into account the case when extra
channels were stored in the TIFF file while ExtraSamples field is not
set. Yet as a side effect of a later channel count, we were setting
`alpha` to TRUE while `save_transp_pixels` was left uninitialized (hence
undefined behavior).

For now let's make sure we have no undefined behavior. When the
ExtraSamples field is missing and at least one extra channel is stored,
we will consider the first extra channel as non-premultiplied alpha
(this is also what we were doing when ExtraSamples was set to
"Unspecified data" and apparently according to Massimo, it would be a
common behavior in other software).

Note that it is an improvement from previous code (no undefined
behaviour anymore, instead we handle explicitly the TIFF error). Yet
this is not perfect yet. Ideally we should pop-up a dialog asking what
to do with this extra channel: either open as a channel (no alpha), or
as premultiplied or non-premultiplied alpha.

(cherry picked from commit b090bc5213)
2019-06-11 15:50:48 +02:00
6a854e45fa Issue #2194: Action search dialog behaves as a full window using a...
... tiling window manager.
Completing commit e6364ffa81 by additionally making sure the search
dialog is non-modal. Otherwise it prevents positionning it wherever we
want and it stays in the center, potentially hiding the canvas and
darkening the main window.

(cherry picked from commit aa1171ada2)
2019-06-11 02:23:07 +02:00
33aada6b6f Update Spanish translation 2019-06-10 08:18:45 +00:00
Ell
9c8e1704c4 Issue #3484 - While moving a nested layer group, some area isn't updated
In gimp_group_layer_translate(), when translating a nested group
layer, call gimp_drawable_update_all() to update the child-layers'
original area *before* updating the group's offset, at which point
the group parent's size is updated, causing subsequent area-updates
during translation to be clipped to the parent's new bounds,
preventing the original areas from being properly cleared.

(cherry picked from commit 4a20a75dc3)
2019-06-10 03:55:44 -04:00
Ell
854374b2ce app: add gimp_drawable_update_all()
Add a new GimpDrawable::update_all() virtual function, and a
corresponding gimp_drawable_update_all() function, which updates
the full contents of the drawable.  Unlike calling
`gimp_drawable_update (drawable, 0, 0, -1, -1)`, which updates the
entire drawable area, gimp_drawable_update_all() only updates the
area that has actual content.  While the default implentation does
simply update the entire drawable area, GimpGroupLayer overrides
this function to recursively update its child layers, rather than
the its entire area.

(cherry picked from commit 3e5cbb03d9)
2019-06-10 03:55:43 -04:00
1f0abe57cc Update Polish translation 2019-06-09 17:26:11 +02:00
d66e7dccac app: add GeglOperation *operation argument to GimpLayerModeBlendFunc
Some blend funcs depend on constants from the specifc color space we are
operating in and needs the space or operation propagated to the worker function
of the operation as discovered in issue #3451.

This commit propagates the operation, leaving the specific blend functions
needing it to call gegl_operation_get_source_space or similar without needing
that overhead for the rest.

(cherry picked from commit 8e90468308)
2019-06-09 12:48:59 +02:00
c897aabcc8 plug-ins: PNG export TRC chosen similarly to TIFF.
While we tend to default to sRGB for 8-bit max formats (such as JPEG or
WebP) when no explicitly-assigned profile was set, there is no need to
do so for PNG too. Indeed since we have the ability to export 16-bit
PNG, let's consider this is ok to export 16-bit linear data when writing
GIMP's default linear profile.

Moreover let's follow the profile's (fallback to storage's) TRC also
when exporting to a specific precision (as chosen manually in the
dialog), not only when sticking to "Automatic", unless we are downsizing
a high bit depth work image to 8-bit without a manually assigned profile
(the only case we forcefully export as sRGB data, hence convert the
profile if linear storage).

(cherry picked from commit 24ed5870ad)
2019-06-07 19:09:00 +02:00
e7cd743b05 plug-ins: simplify code a bit by removing useless variable.
(cherry picked from commit 8cd3f5a853)
2019-06-07 19:06:40 +02:00
39672c8559 plug-ins: add the 8-bit linear with no assigned profile exception...
... in JPEG export.
Same as the WebP export, which is quite similar (8-bit max format), when
no profile was explicitly set, we want to convert any data from storage
format to non-linear (unlike when exporting high bit depth formats, such
as TIFF).
We only make an exception for 8-bit linear. This commit adds this
exception.

(cherry picked from commit 0461022198)
2019-06-07 19:05:23 +02:00
bb9571db60 plug-ins: remove the "Advanced Options" expander in WebP export dialog.
Similarly to other export dialogs, we don't consider anymore metadata or
profile writing as being advanced options. Since these were the only
options shown in our current WebP export dialog, I removed the expander
altogether and moved everything out.

See also commit 540cfa9611.

(cherry picked from commit 26ba915ca5)
2019-06-07 19:02:04 +02:00
5c8860bd49 plug-ins: fix profile writing in save_animation() in WebP export.
Profile and output linearity decision was doubled as save_layer() and
save_animation() and I realize that I forgot to update the
save_animation() one in earlier commits.

To avoid code copy-paste and divergence, I added an internal
webp_decide_output() function which I use in both aforementionned calls.

(cherry picked from commit 6712228e5e)
2019-06-07 19:01:56 +02:00
0aad97cc18 plug-ins: add a "Save color profile" checkbox in WebP export.
Unlike most other formats, it didn't have one yet!

(cherry picked from commit 96e37dfdaf)
2019-06-07 19:01:49 +02:00
1bdac39a92 plug-ins: improve decision on exported data format in Webp.
Same as other formats, we make sure that an explicitly set profile TRC
is always followed. When no profile is set, we always export as sRGB
when there is precision downsizing to avoid shadow posterization, since
WebP stores 8-bit max per channel (as far as I know, or at least as far
as we implemented it in our plug-in).
We only take the storage format into account when it is 8-bit linear
with profile export. In such case, we avoid conversion from 8-bit linear
to 8-bit sRGB.

This is different to TIFF export for instance, where we fallback on
following storage format TRC as we are able to export all sort of
precisions, hence with minimum quality loss.

(cherry picked from commit 2a1eabc177)
2019-06-07 19:01:34 +02:00
a11cc8a63d plug-ins: improve decision of exported data format in TIFF export.
Same as we did for PNG and JPEG, we want to always export data with the
TRC of a profile manually assigned, and in particular NOT the curve of
the storage in GIMP (i.e. you may work on 32-bit linear, yet if you
assigned a sRGB TRC profile, this is what you should export). The
storage format will only dictate the exported data TRC when writing out
the default profile (i.e. no explicit profile assignement).
As a last case, when no profile is saved, we always export as sRGB.

As for the export precision, we always follow the storage one's, except
sometimes for 8-bit images. We promote 8-bit images to 16-bit if and
only if the storage does not match the export data linearity, to avoid
too much quality loss during format conversion.

(cherry picked from commit 8d9e70011d)
2019-06-07 18:57:40 +02:00
Ell
7acb6f36ab app: indentation fix in gimp:offset
(cherry picked from commit 8c1567f901)
2019-06-07 03:54:39 -04:00
Ell
618b6a62bd app: in gimp:offset, fix OFFSET_TRANSPARENT fast-path for chunked input
(cherry picked from commit 533091055e)
2019-06-07 03:49:49 -04:00
Ell
257e35dda1 app: avoid duplicate offset actions
Blacklist the "tools-offset" action in the GUI, and only keep
"filters-offset", to avoid duplication.  Update gimp:offset's
description, so that "filters-offset" gets a proper tool-tip.

(cherry picked from commit 42d4255262)
2019-06-06 04:52:32 -04:00
Ell
0d7a57d782 app: add GimpFilterTool::region_changed() virtual function
Add a new GimpFilterTool::region_changed() virtual function, which
gets called whenever the filter region changes, either due to a
change to the tool's "region" option, or a change to the image
mask.

Override GimpFilterTool::region_changed() in GimpOperationTool and
GimpOffsetTool, instead of listening to a change to the "region"
option in GimpTool::options_notify(), so that the tools are
properly updated when the image mask changes.

(cherry picked from commit 066827e23c)
2019-06-06 03:15:10 -04:00
Ell
3af7c508ad app: in gimp_filter_tool_get_drawable_area(), don't return empty area
In gimp_filter_tool_get_drawable_area(), when the image mask
doesn't intersect the drawable, return a minimal area, instead of
an empty/invalid area.

(cherry picked from commit 428ee0e2ad)
2019-06-06 03:10:04 -04:00
Ell
175e3ea7d9 app: various fixes/cleanups to last commits
(cherry picked from commit 30429e30e2)
2019-06-06 03:10:03 -04:00
Ell
ca4612cc43 Issue #40 - Layer offset tool
Add a new Offset filter tool, as a front-end to gimp:offset.  The
tool replaces, and provides the same interface as, the drawable-
offset dialog, while also providing live preview and on-canvas
interaction.

Note that we don't simply use a custom propgui constructor for
gimp:offset, since we need a little more control.

(cherry picked from commit 3a4a00c71e)
2019-06-05 19:10:52 -04:00
Ell
003b138ee6 app: implement gimp_drawable_offset() in terms of gimp:offset
Implement gimp_drawable_offset() in terms of gimp:offset, added in
the previous commit.  Other than avoiding duplication, this also
allows gimp_drawable_offset() to respect the current selection and
component mask (see issue #39.)

(cherry picked from commit 5b2f3980bd)
2019-06-05 19:10:51 -04:00
Ell
f7a1aec1e9 app, libgimpbase: add gimp:offset operation
Add a new gimp:offset operation, which implements equivalent
functionality to gimp_drawable_offset(), in preparation for adding
an interactive offset tool.

To simplify things, add a GIMP_OFFSET_WRAP_AROUND value to the
GimpOffsetType enum, to avoid the need for a separate wrap-around
flag.  This makes the gimp-drawable-offset procedure parameters a
little superfluous, but whatever.

(cherry picked from commit 40fefb6076)
2019-06-05 19:10:49 -04:00
Ell
fce4e98097 plug-ins: in file-tiff, don't leak image when not saving layers
In file-tiff, when not saving layers, avoid duplicating the image
to create the merged version if it's already been duplicated, and
make sure to delete the duplicated image otherwise.

(cherry picked from commit 8831ef2ea0)
2019-06-03 12:43:21 -04:00
Ell
186236ff35 app: update drawable when committing Warp tool
Make sure to update the drawable after committing the Warp tool, if
high-quality-preview is disabled, and we use a non-nearest sampler.

Necessary after commit d928a80b7f.

(cherry picked from commit 2da5cb562d)
2019-06-03 09:58:45 -04:00
eae506a9da Updated Italian translation 2019-06-03 11:17:48 +02:00
e905f84a52 Issue #2057 - All tool presets change FG, BG and Pallete color...
...even when not supposed to

Don't use gimp_config_copy() to set the tool options from the ones
stored in the preset. Instead, add utility function
tool_manager_copy_tool_options() that only copies properties of
GimpToolOptions and its subclasses.

Simply set the tool, copy the tool options' context properties, then
copy the tool options' own properties and done. Much more obvious and
works.

(cherry picked from commit a14834e336)
2019-06-02 15:17:07 +02:00
46f94d2c75 app: remove redundant assignment in gimptoolpreset.c
(cherry picked from commit 8d1c36d9ce)
2019-06-02 15:14:28 +02:00
bf18c3162f Update Polish translation 2019-06-02 14:09:26 +02:00
645d987e07 Issue #2957 - Gimp crashes when I attempt to change the icon size
Simplify GimpDockbook's signal connect/disconnect to
GimpGuiConfig::size-changed a lot, most likely to a point where some
connection doesn't get leaked, so this bug is probably fixed.
2019-06-02 03:29:19 +02:00
Ell
9db555149f app: avoid unnecessarily updating drawable after merging filter
In gimp_drawable_merge_filter(), add an "update" parameter, which
specifies whether to update the affected region of the drawable
after applying the filter.  Avoid updating the drawable when
commiting a GimpDrawableFilter (and manually update the drawable if
filter application was cancelled), and when anchoring a floating
selection, since in both cases the relevant region of the drawable
has already been updated.

(cherry picked from commit d928a80b7f)
2019-06-01 13:29:04 -04:00
99ae9a32da Update Hungarian translation 2019-06-01 16:58:25 +00:00
a624010931 Issue #2194 - Action search dialog behaves as a full window...
...using a tiling window manager

Set GimpSearchPopup's type hint to GDK_WINDOW_TYPE_HINT_DIALOG.

(cherry picked from commit e6364ffa81)
2019-06-01 17:40:37 +02:00
dd3529c0e9 libgimpwidgets: keep gimpwidgetsenums.h in alphabetical order
(cherry picked from commit 2f925e7277)
2019-06-01 16:43:07 +02:00
ef6bb9d4ad Issue #2643 - Conversion to grayscale fails with artifacts
Connect GimpDisplayShell to GimpImage::mode-changed and update its
cached color transforms. Also get rid of a duplicate conection to
GimpImage::precision-changed.

(cherry picked from commit a1aa179436)

No idea why the artifacty never appeared on 2.10, the code was just as
broken as in master...
2019-06-01 14:27:00 +02:00
Ell
fe9c1732b9 app: add "alpha" propertry to gimp:mask-components
In gimp:mask-components, add an "alpha" property, which controls
the masked-in alpha value in case there's no aux buffer.  Set it to
0 by default, so that gimp:mask-components behaves normally in the
absence of an aux buffer (as if the aux buffer was empty).  Set it
to 1 in the image's visible-mask node, to maintain the current
alpha-component visibility behavior.

This fixes incorrect results when the output bounding box of a
drawable filter is smaller than the drawable, which can lead to a
NULL aux buffer being fed to the filter's gimp:mask-components
node.

(cherry picked from commit 6425bf820a)
2019-05-31 13:11:26 -04:00
Ell
e457ddf993 Revert "app: avoid NULL output in layer-mode ops"
On a second thought... nope :)  We'll fix it another way.

This reverts commit 60947b7a34826657395ca485d334ccb302106e07.

(cherry picked from commit 3766af9ac9)
2019-05-31 13:11:26 -04:00
Ell
818570d6cc app: avoid NULL output in layer-mode ops
In GimpOperationLayerMode and GimpOperationReplace, make sure we
don't return a NULL output buffer, or forward a NULL input buffer,
but rather create an appropriate empty buffer in this case.  This
avoids wrong results when the layer-mode op's output is connected
to the aux input of a subsequent op, as a result of the op behaving
differently with a NULL aux buffer (in particular, this can happen
when a drawable filter's output bounding box is smaller than the
drawable.)

(cherry picked from commit 8fcac3298c)
2019-05-31 12:25:47 -04:00
c8fb30ab3c Issue #3057 - Retain last user-chosen ICC profile information...
...when generating "TRC variants"

When creating a new profile with different TRC from an existing
profile, keep all the original profile's description, model,
manufacturer and copyright strings around, but prefix them with "GIMP
from " or similar to indicate that they are different. Also make sure
we don't prefix strings with GIMP stuff multiple times when profiles
are generated repeatedly.

(cherry picked from commit 3cad4aa4c2)
2019-05-31 15:48:13 +02:00
8d05d01820 app: fix undoing image parasite attach/detach to emit the right signals
Add "gboolean push_undo" parameters to gimp_image_parasite_attach()
and _detach() and use the API also from undo, instead of implementing
attaching/removing manually and forgetting about the signals.

Fixes updating of the image properties color profile page.

(cherry picked from commit 710cfc1f47)
2019-05-30 16:58:53 +02:00
29ef374228 app: make sure builtin profiles *really* don't get attached to images
gimp_image_parasite_attach(): when we detected that a builtin profile
is about to be attached, actually bail out after removing the old
profile, instead of continuing to attaching the builtin profile
anyway. Gah...

(cherry picked from commit 07ffef38c3)
2019-05-30 16:15:51 +02:00
20b47618d0 app: use the DEFAULT_USE_PATTERN define instead of TRUE in GimpPreset
(cherry picked from commit e7307194cf)
2019-05-30 11:50:46 +02:00
Ell
0c4c1f1a8c app: s/gimp_list_compare()/gimp_g_list_compare()/
... so we don't clash with the GimpList namespace.

(cherry picked from commit 8ef461bb70)
2019-05-30 03:31:51 -04:00
Ell
80ea17d90b app: fix memory leak in previous commit
(cherry picked from commit 08ebcce2fa)
2019-05-30 02:43:53 -04:00
Ell
38e954ba25 app: allow moving an intersecting pair of guides with the Move tool
This commit adds support for moving together an intersecting pair
of guides using the Move tool, by dragging the guides at their
point of intersection.  This is useful when the guides are used to
mark a point, rather than a pair of lines (e.g., as is the case for
the mandala symmetry guides, which mark the symmetry's point of
origin).

Add gimp_image_pick_guides(), which can return a set of guides,
rather than a single guide.  The API allows an arbitrary set of
guides to be returned, but, in practice, at most two intersecting
guides are returned, as per the above.

In GimpMoveTool and GimpGuideTool, add support for moving multiple
guides together, and, in GimpMoveTool, use gimp_image_pick_guides()
to potentially pick multiple guides.

(cherry picked from commit 1e95481feb)
2019-05-30 01:52:03 -04:00
Ell
4dd3e73aaa app: add gimp_list_compare()
... which lexicographically (shallowly) compares a pair of GLists.

(cherry picked from commit c4ce70a2d3)
2019-05-30 01:52:03 -04:00
7b4ef46fe4 Issue #3119 - Two tooltips were marked as translatable
(cherry picked from commit b1c113c444)
2019-05-30 00:42:02 +02:00