Commit graph

41082 commits

Author SHA1 Message Date
Jehan
8509117fe6 app: actually resolve the interpreter through extension as last resort.
Current code of gimp_interpreter_db_resolve() was only resolving the
interpreter by the file extension when the file could not be opened for
reading or if it was empty/coult not be read. This basically made this
test completely useless.
Let's fix this. Now it will be run all the time, but simply at the end,
if shebang and magic failed.
2018-06-16 02:05:08 +02:00
Ell
d6792c973b app: fix scaling around center in scale tool; avoid negative width/height
In GimpScaleTool, fix scaling around the center-point, and make
sure the width and height are always >= 1 when updating the
transformation in response to a widget change.

(cherry picked from commit 1516bfc14b)
2018-06-15 16:05:13 -04:00
Ell
c7895c9752 app: clean up GimpTransformGridTool; adapt subclasses
Get rid of GimpTransformGridTool::recalc_matrix() and
gimp_transform_grid_tool_recalc_matrix(), and have
GimpTransformGridTool and its subclasses use
GimpTransformTool::recalc_matrix() and
gimp_transform_tool_recalc_matrix() directly instead.

In order to break the GimpToolWidget::changed/
GimpTransformTool::recalc_matrix() loop, add a
GimpTransformGridTool::update_widget() vfunc, which subclasses
should override to update their tool-widget (instead of doing this
in ::recalc_matrix()), and ::widget_changed(), which is called when
the tool-widget changes (and which subclasses should override
instead of connecting to the tool-widget's "changed" signal
directly.)  GimpTransformGridTool calls these functions as
necessary, instead of relying on extra parameters passed to
recalc_matrix().

Adapt all the direct and indirect subclasses of
GimpTransformGridTool to the change.

(cherry picked from commit 6a3fc6c1b9)
2018-06-15 16:05:13 -04:00
Jehan
130ef5ce59 Issue #248: Python console doesn't support input()/raw_input().
As noted by Massimo, we can just make the argument of raw_input() an
optional argument.

Also adding a modal implementation for input() so that it doesn't lock
the Python console waiting from input from the plug-in stdin. As noted
in Python doc, input() is equivalent to `eval(raw_input(prompt))`.
Not all that safe, but in the end, it is the developer's responsibility.
2018-06-15 18:34:57 +02:00
Jehan
b3cf7abd20 configure, tools: actually use GIMP_PKGCONFIG_VERSION and...
... GIMP_TOOL_VERSION rather than hardcoding versions.

Mostly cherry picked from commit 276d9b60b3
except pkg-config still checks gtk+-2.0 (not 3.0) on gimp-2-10 branch.
2018-06-15 17:36:33 +02:00
Ell
387cc35c58 Issue #1624 - Crashes when using Scissor Select Tool
In GimpTool, always clear tool->drawable upon halting, even for
tools that don't use it explicitly.

GimpTool sets tool->drawable in its default button_press()
implementation, and we potentially access it in
gimp_display_shell_initialize_tool(), so failing to clear it when
halting the tool may leave it as a dangling pointer, which can
result in a segfault when trying to initialize the tool in the
above function.  In particular, this happens with the iscissors
tool.

(cherry picked from commit 58c96f596e)
2018-06-15 08:19:51 -04:00
Simon Mueller
aac958607d plug-ins: use g_fopen(filename, "w+b")...
...because g_fopen(filename, "wb+") fails on Windows.

(cherry picked from commit 541f730f44)
2018-06-15 11:02:24 +02:00
Michael Schumacher
73c67d9612 plug-ins: use g_fopen(filename, "w+b") instead of "wb+" to fix SGI format export on the Microsoft Windows platforms
(cherry picked from commit c93727e791)
2018-06-15 08:06:25 +00:00
Ell
32993ab12d Issue #1646 - Transform preview looks wrong with selection
In GimpCanvasTransformPreview, when the image mask is not empty,
make sure to align it with the drawable using a gegl:translate
node, before combining both at the gegl:opacity node.  Otherwise,
the mask is applied at the wrong offset when the drawable's offset
is not (0, 0).

(cherry picked from commit d3a3c35317)
2018-06-15 01:59:45 -04:00
Ell
e486537ce0 Issue #1613 - foreground select tool raises a CRITICAL when committing
Make gimp_free_select_tool_halt() protected, and call it in
gimp_foreground_select_tool_set_trimap(), so that the free-select
subobject of the foreground-select tool is properly shut down
before switching to trimap mode.  In particular, this clears the
free-select tool widget at the right point; failing to do this
leads to CRITICALs later on.

(cherry picked from commit e15733236c)
2018-06-14 19:51:55 -04:00
Ell
08294f9ea7 Issue #1602 - Numeric selection size wrong after switching tools
In GimpToolRectangle, call gimp_tool_rectangle_update_options()
when the "[xy][12]" properties change, so that the "x", "y",
"width", and "height" properties are updated accordingly.

In particular, we set these properties when committing an empty
rectangle select tool, to init the rectangle to the current
selection bounds, and this call is necessary so that the "x", "y",
"width", and "height" tool options are properly updated as well.

(cherry picked from commit 47b7e7be7d)
2018-06-14 12:33:56 -04:00
Jehan
1a14f7e8c9 INSTALL: libheif must also be built with libx265.
(cherry picked from commit 33749491af)
2018-06-14 16:35:32 +02:00
Jehan
8ede025cee icons: clean the symbolic vector file.
All icons are now in the file.

(cherry picked from commit 3096fd295a)
2018-06-14 16:35:08 +02:00
Jehan
98763dded9 icons: fix symbolic icons.
With the symbolic-awareness of GTK+, vector icons are recolored (using
fg, success, warning and error colors). Unfortunately it was also
recoloring some rectangles with neither fill nor stroke, which were
using only to get appropriate icon size (these icons were therefore
displayed as just a square).

I made a quick pass in our icons to "fix" these. I expect I may have
missed some icons, or at the opposite, I may have broken other icons by
removing rectangles which should not have been removed. If you find any
such icon, please fix.
Also some icons do not look quite right just now. We will have to create
new guidelines on how to make symbolic icons and fix/redesign some, I
guess.

(cherry picked from commit 0c3659c5f1)
2018-06-14 16:35:08 +02:00
Jehan
dc8f44c6fa desktop: start a <release> tag for 2.10.4.
The 2 major changes seem to be the much-awaited font loading in
background, and this new "Auto straighten" option on Measurement tool.

Please everyone, feel free to tweak the release description while it is
still commented out. Once we remove the comment tags, it will be
submitted for translation.
2018-06-14 16:20:29 +02:00
Anders Jonsson
7412507c82 Update Swedish translation 2018-06-14 11:12:27 +00:00
Ell
5e53d06f74 app: make sure image colormaps always have at least one color
In gimp_image_set_colormap(), make sure the image's colormap always
has at least one color -- babl palette formats must have at least
one color.

If the function is called with 0 colors, use black.  We still need
to support this case, in particular, since existing XCFs may have
an empty colormap, and since plug-ins can call
gimp-image-set-colormap with 0 colors.

(cherry picked from commit c16c68e63e)
2018-06-14 03:19:29 -04:00
Jehan
f634757266 Revert "Issue #1612: Symmetry Painting dock needs a design tweak."
This reverts commit 55c5ebea3c.
Argh "valign" is a GTK+3 property. And actually testing now, I realize
this bug was only in the GIMP 3 codebase.
2018-06-14 03:59:04 +02:00
Jehan
5b628d422f plug-ins: add busy-dialog plug-in in plugin-defs.pl.
Introduced in commit 032e95fad6, Makefile.am was apparently directly
edited instead of plugin-defs.pl. This also fixes a typo:
s/bust-dialog/busy-dialog/

(cherry picked from commit 4117c98655)
2018-06-14 03:25:41 +02:00
Jehan
55c5ebea3c Issue #1612: Symmetry Painting dock needs a design tweak.
Make symmetry painting dock top-aligned.

(cherry picked from commit 035cef696a)
2018-06-14 03:25:32 +02:00
Michael Natterer
738bf71200 Issue #1634 - PNG image opens as a blank one in GIMP
Set the libpng error_fn to NULL *after* png_read_end() not before.
png_read_end() can throw errors and we recover what's partially loaded
from an image in the error handler.

(cherry picked from commit db08271d16)
2018-06-13 19:09:51 +02:00
Hannie Dumoleyn
0e61cb1203 Update Dutch translation 2018-06-13 11:18:18 +00:00
Michael Natterer
d76a6e8c11 plug-ins: pack the file-heif load dialog's icon view cells manually
There is something broken in the obscure "text_column" and
"pixbuf_column" code in GtkIconView, and I don't have the nerve to
debug it.

Enable opening an image on activation (double click).

(cherry picked from commit 625aa514f6)

(picking the icon view change was not neccessary but this plug-in will
get more updates so let's keep the code in sync)
2018-06-12 18:36:47 +02:00
Michael Natterer
6125d225ac plug-ins: put file-heif's icon view into a scrolled window 2018-06-12 13:34:24 +02:00
Michael Natterer
3b007f70f0 plug-ins: undeprecate file-heif but only as much as can be merged to 2.10
(cherry picked from commit afd4045866)
2018-06-12 13:26:40 +02:00
Michael Natterer
40c24dc3d0 Issue #1627 - Non-existing item ID error when loading multiple-image HEIFs
Accidentially killed a line when importing the plug-in.

(cherry picked from commit 1dee517bc9)
2018-06-12 12:58:37 +02:00
Marco Ciampa
e168c68b0c Updated Italian translation 2018-06-12 12:02:20 +02:00
Ell
3c9d513be9 Issue #1621 - Alpha incorrectly exported in PSD
In file-psd, fix the creation of the "merged" image data, saved in
PSD files along with the actual layer data.

(cherry picked from commit 8a01866af0)
2018-06-11 21:05:23 -04:00
Michael Natterer
c42c25732b all: make GimpDataLoaderFactory less static
Add functions to register loaders, remove the static array of loaders
given at construction time.

(cherry picked from commit f997106fb2)
2018-06-10 15:54:45 +02:00
Michael Natterer
561655bfb3 app: GimpToolPreset: s/GimpTransformOptions/GimpTransformGridOptions/
when deserializing the tool options.
2018-06-10 15:54:45 +02:00
Michael Natterer
bd30f28b09 app: if --verbose, make GimpDataFactory print each loaded and saved data 2018-06-10 15:54:45 +02:00
Piotr Drąg
1ae02929bc Update Polish translation 2018-06-10 15:42:57 +02:00
Ell
341077e23a Bug 759194 - Unified Transform Tool fails when layer is hidden
Last commit reintroduced this bug.

Allow transforming invisible layers using transform-grid tools, by
adding a 'drawable' member to GimpTransformTool, and setting/
clearing it when initializing/halting a GimpTransformTool.  In
gimp_transform_tool_check_active_item(), skip the visibility check
if the active item equals the GimpTransformTool's 'drawable'
member.

(cherry picked from commit cea6f1dc73)
2018-06-10 07:26:22 -04:00
Ell
d670edb339 app: don't allow transforming invisible layers in flip/measure tools
Split gimp_transform_tool_get_active_item() into two functions:
gimp_transform_tool_get_active_item(), which returns the item
without checking for errors, and
gimp_transform_tool_check_active_item(), which returns the active
item while checking for errors.  Adapt the rest of the code to the
change.

Remove the invisible_layer_ok parameter of
gimp_transform_tool_check_active_item(), and always return an error
when the active layer is invisible.  This causes the flip and
measure tools to correctly reject invisible layers.  Un-hide the
active item in GimpTransformGridTool before transforming, to avoid
rejecting layers that were hidden by the tool.

(cherry picked from commit 360b25b9a8)
2018-06-10 03:57:20 -04:00
Ell
1bd6079388 Issue #1607 - Fatal Crash on ACT Palette File Import
... and various other palette formats

Change accidental 'G_IS_INPUT_STREAM (file)' argument validation to
'G_IS_INPUT_STREAM (input)'.

(cherry picked from commit ea6d997e56)
2018-06-10 01:47:31 -04:00
Ell
70304ef75d app: code cleanup in the measure tool
(cherry picked from commit 845a19b785)
2018-06-10 01:26:14 -04:00
Ell
eccabd9ac9 app: derive GimpMeasureTool from GimpTransformTool
Derive GimpMeasureTool from GimpTransformTool (and
GimpMeasureOptions from GimpTransformOptions), so that we can reuse
GimpTransformTool's logic for the "straighten" function.  This
simplifies the code, aligns the measure tool with the rest of the
transform tools in terms of transform-related options (it can now
transform selections and paths, in addition to layers, and the
resampling method and clipping behavior are adjustable,) and fixes
straightening of layer groups.

Rename the function from "auto straighten" to just "straighten".

Don't resize the canvas after straightening.  Since we only
transform the active layer, and not the entire image, resizing the
canvas doesn't make much sense.

When in 3-point mode, rotate the second point toward the third
point, rather than toward the x-axis.

(cherry picked from commit b0cf2e435a)
2018-06-09 18:30:38 -04:00
Ell
340c4a2309 app: add GimpTransformGridTool; derive most transform tools from it
While most of our transform tools use an interactive transform
grid, and have similar behavior, the flip tool is an odd one out.
The new "auto straighten" function of the measure tool introduces
another tool that performs transformations, while not behaving like
the rest of the transform tools.

Factor out the parts of GimpTransformTool that handle user
interaction into GimpTransformGridTool (with corresponding
GimpTransformGridOptions, and GimpTransformGridToolUndo), and only
leave the basic transform functionality and options in
GimpTransformTool (and GimpTransformOptions).

Derive all the transform tools (and transform-tool base classes)
that previously derived from GimpTransformTool, from
GimpTransformGridTool.  The one exception is GimpFlipTool, which
still derives from GimpTransformTool directly.  The next commit
will derive GimpMeasureTool from GimpTransformTool as well.
2018-06-09 18:30:28 -04:00
Michael Natterer
93025adf02 Issue #1435 - Add tooltips to GimpColorNotebook's tabs
(cherry picked from commit 8d6f023b41)
2018-06-08 19:46:29 +02:00
Michael Natterer
def91dfc59 libgimpwidgets: install gimpbusybox.h as public header
(cherry picked from commit b75cbcb417)
2018-06-08 18:59:41 +02:00
Alex Samorukov
15f8ed090c Fix build on osx by adding appkit dependency
(cherry picked from commit f464ea0d4e)
2018-06-08 13:00:22 +02:00
Michael Natterer
22ae38d024 Issue #1441 - Copy paste issue, internal clipboard blocks global clipboard
Never return an internal image/buffer/svg/curve from any
gimp_clipboard function if we are not the owner of the display's
clipboard. The clipboard is supposed to be a global thing, and we must
only offer to ourselves what would be pasted in any other app.

(cherry picked from commit 7d3a129ddd)
2018-06-08 11:42:18 +02:00
Ell
aeff285216 app: in GimpPaintTool, sync brush-outline coords while painting
Add GimpPaintTool::paint_[xy] members, and periodically assign the
paint core's current coords to them in
gimp_paint_tool_paint_timeout(), while the main thread and the
paint thread are synchronized, during painting.

In gimp_paint_tool_draw(), fetch the current coords for the brush
outline from the above members during painting, instead of directly
from the paint core, to avoid a race condition with the paint
thread, so that we always use the correct coordinates at the time
the paint buffer was flushed back to the drawable.

(cherry picked from commit 5c17d2a43b)
2018-06-08 03:25:32 -04:00
Piotr Drąg
696d5b7f71 Update Polish translation 2018-06-07 16:22:38 +02:00
Michael Natterer
05747f75d5 Issue #1291 - Non-intrusive warning when saved XCF version...
...won't work with older GIMP?

Make gimp_image_get_xcf_version() return a "reason" string which lists
all reasons why the image can't be saved with compatibility for older
GIMP versions. Display the reason as tooltip on the compat hint label
in the save dialog.

(cherry picked from commit a4061a6b0d)
2018-06-06 23:12:04 +02:00
Ell
8a127d795e app: use default new-layer mode for layer groups and text layers
When creating a layer group, or a text layer, use the image's
default new-layer mode, instead of always using (non-legacy)
NORMAL.

(cherry picked from commit 7c7b6eb537)
2018-06-06 02:40:55 -04:00
Rodrigo
dc1ab40a41 Update Spanish translation 2018-06-06 06:23:36 +00:00
Jehan
2f24ee58a1 NEWS: also add gimp-test-clipboard. 2018-06-06 02:11:36 +02:00
Jehan
db6e8d51e6 NEWS: keep up-to-date. 2018-06-05 23:51:29 +02:00
Jehan
82fbfdf9d4 app: do not stop the measurement when straightening.
Instead just transform the measurement extremities appropriately to
still map to the same points.
To do so, I also added out parameters to gimp_image_resize_to_layers()
so that calling code can get offsets from old origin (as well as new
image dimensions).

(cherry picked from commit d56a8d439e)
2018-06-05 23:36:24 +02:00