Commit Graph

41747 Commits

Author SHA1 Message Date
Jehan 2bb8afd119 icons: fixing more icons.
This time, 2 icons still had problems because of visible rectangles.
Fixing "gimp-prefs-folders" and "gimp-prefs-folders-mypaint-brushes".
2018-06-19 15:25:46 +02:00
Jehan 4b6869dd67 icons: fix various icons broken when recoloring with CSS.
For anyone wishing to help me fix icons, here is the trick: apparently
GTK+ would fill the paths with CSS colors, not stroke them. So when we
have icon drawing based on path-stroking, they don't end up as expected.
In Inkscape, just run "Stroke to Path" to transform a stroke design in a
fill design.
I am fixing "gimp-tool-cage", "document-revert", "gimp-image-reload",
"gimp-reset" and "view-refresh". More to follow as we discover them, I
guess.
2018-06-19 15:14:36 +02:00
Jehan 45f46db815 icons: make gimp-tool-ellipse-select symmetric.
I may not be an icon designer, but this icon be so clearly asymmetric
always deeply annoyed me.
2018-06-19 14:38:37 +02:00
Michael Natterer 6c506509b6 app: remove gimp_layer_mask_new_from_buffer() and some includes 2018-06-19 13:20:15 +02:00
Michael Natterer f815a2d922 Issue #1677 - Alpha channel copy / Layer Mask issues
gimp_layer_create_mask(): make sure we don't do a gamma conversion
when initializing the mask from a channel. This was probably not the
last place to need this fix.

Also get rid of a second switch(add_mask_type), must be some leftover
from long gone logic.
2018-06-19 12:37:59 +02:00
Michael Natterer 89776dbff5 app: fix drawing the focus around the selected color in GimpPaletteView
The grid lines are always black, so always draw a black/white focus
line and ignore theme colors.

(cherry picked from commit 4cc6f18cc9)
2018-06-18 19:22:22 +02:00
Michael Natterer 5ebc7909a3 plug-ins: clean up pagecurl build, update .gitignore 2018-06-18 12:41:57 +02:00
Ell 1d9a8a91ab plug-ins: add support for loading merged image data from PSD files
PSD files may include a "merged", pre-composited, version of the
image (in Photoshop, this is the case when saving files with
"Maximize Compatibility" enabled; GIMP always saves the merged
image data in exported PSD files.)  This commit adds support for
loading the merged image version from PSDs, instead of the full
layer hierarchy.  This is useful when loading PSD files that use
features that we don't currently support, and therefore can't
render correctly, such as adjustment layers.

When loading the merged image version, we avoid loading certain
additional data from the file, such as channels, paths, and
guides, while still loading metadata, making this akin to loading
other "flat" image formats.

This option is currently exposed as an additional file type
("Photoshop image (merged)"), which has to be explicitly selected
from the file-type list when opening the image.
2018-06-18 06:34:32 -04:00
Salamandar 38295dcb82 Replace #include .c -> #include .h
glib_compile_resources generate .c as sources and .h as headers
2018-06-18 11:52:23 +02:00
Michael Natterer fe648c87bd libgimp: remove gimp_gamma() 2018-06-18 03:06:34 +02:00
Michael Natterer 8c9c091021 Issue #701 - Add the ability to embed the GIMP built-in sRGB profile...
...upon exporting an image

Step 1: make it configurable just like "Export EXIF" etc.

app, libgimp: add "export-color-profile" config option

Add it to the preferences dialog, and pass it on to plug-ins in the
GPConfig message. Add gimp_export_color_profile() to libgimp.

Nothing uses this yet.
2018-06-18 02:19:41 +02:00
Michael Natterer e0f46d1dc9 app: cleanup in GimpClipboard
Mostly formatting and thortening variables. Only real change is adding
gimp_clipboard_new() and moving most init() code there.
2018-06-18 01:47:35 +02:00
Michael Natterer 9c8d2a6e89 themes: make stuff in GimpTextStyleEditor smaller
like in docks and tool/overlay dialogs
2018-06-18 01:04:08 +02:00
Michael Natterer 5ee48e9ef3 app: undeprecate GimpTextStyleEditor, and set a CSS name for themeing 2018-06-18 00:59:11 +02:00
Edward E f18fcd468e Issue #1240 - The drive or unc share you selected does not exist...
...or is not accessible

Installer: show install path on final confirmation page
2018-06-17 22:55:17 +02:00
Jehan 3a0c03a61c plug-ins: clearer plug-in-screenshot parameter description.
Our plug-ins have no "optional" parameters per-se. Clarify the
description to make explicit that the last 4 parameters are simply only
taken into account when the shoot type is SHOOT-REGION.
2018-06-17 22:16:03 +02:00
Ell 6d8128e3e0 app: fix filename in gimppropgui-recursive-transform.c license notice 2018-06-17 15:59:11 -04:00
Ell 56d15e83e9 app: merge back gegl:recursive-transform-plus propgui to recursive-transform
... following GEGL commit 6be0a86583f9c10c7710c96c21c261e4227c4727.

gegl:recursive-transform now allows applying multiple
transforamtions simultaneously, using multiple transform-grid
widgets.
2018-06-17 15:49:35 -04:00
Michael Natterer d94b954c2a Issue #1611 - plug-in-screenshot does not work in non-interactive run mode
Turn the boolean "root" argument into enum ShootType and reorder that
enum to { WINDOW, ROOT, REGION } so that the "0", and "1" values match
the former boolean. Adapt parameter checking accordingly so that
callers without optional arguments (e.g. script-fu) can call all the
plug-ins's features.
2018-06-17 20:55:09 +02:00
Ell 5a07876c78 Issue #1668 -- Smudge Tool - Wrong colors when painting on an image ...
... with a color profile other than the gimp built-in.

When initializing the smude tool's accum buffer, use
gimp_pickable_get_pixel_at(), instead of
gimp_pickable_get_color_at(), for picking the initial color to fill
the buffer with, so that we don't erroneously apply the image's
color tranform to it when the image has a profile.  Previously,
this would result in wrong colors when painting from the drawable
edges inward, with flow < 100%.
2018-06-17 14:24:10 -04:00
Michael Natterer eaddef595e app: make sure crash-saving of open images to XCF doesn't call the GUI
gimp_eek(): simply increase gimp->busy so XCF saving calling
gimp_set_busy() and gimp_unset_busy() won't call the GUI layer and do
whatever windowing system calls to set busy cursors.
2018-06-17 19:43:34 +02:00
Ell e58e2ec5dc Issue #1668 - Smudge Tool - Wrong colors when painting on an image ...
... with a color profile other than the gimp built-in.

Remove the separate alpha-channel copy in
gimp_image_color_profile_srgb_to_pixel().  We no longer need it,
since GimpColorTransform already takes care of that itself.

We used babl_process() to copy the alpha, which would also
transform the input color from R'G'B' to the output color space.
When the same buffer was used for both input and output, this call
would overwrite the input to the subsequent
gimp_color_transform_process_pixels() call; when the output color
space was different than R'G'B', this meant we'd pass the input to
gimp_color_transform_process_pixels() in the wrong color space,
producing wrong results.  This was the case when converting the
foreground color for use with the smudge tool.
2018-06-17 13:36:33 -04:00
Piotr Drąg 3c608c6ba7 Update Polish translation 2018-06-17 17:14:47 +02:00
Michael Natterer 93d28ceccc Isse #1476 - strange behavior in Layer resize dialog
resize_dialog_new(): create the preview with "popup = TRUE", so we
really get a preview of layer size and not of the layer within the
image context like used for the layers dialog.
2018-06-17 15:33:53 +02:00
Michael Natterer 697ff4b423 app: show the added tab in gimp_dockbook_page_added()
and remove all other calls to gtk_widget_show(child). We used to do
this in gimp_dockbook_add() before (which is gone), and missed to add
a few show(). Since we have no invisible pages, simply show them
gemerically.
2018-06-17 15:14:15 +02:00
Michael Natterer 552a60b8bf app: some g_return_if_fail() were missing or non-standard in GimpContext 2018-06-17 15:12:26 +02:00
Michael Natterer f06d0485e6 app: don't g_return_if_fail() in gimp_device_info_set_device()
when the GimpDeviceInfo already has a device. This is not a programming
error that should trigger a bug report popup, it's something else about
non-uniqueness of device names, or whatever. Simply g_printerr() a more
useful message that can help to debug this and bail out.
2018-06-17 15:09:56 +02:00
Michael Natterer 4260fa3e78 app: some cleanup in GimpContext
Use more g_clear_object() and g_clear_pointer() and remove useless
comments.
2018-06-17 14:42:44 +02:00
Michael Natterer ed1e2b1524 Issue #1213 - Text Tool Preset does not restore font face/name...
...after program restart

GimpContext was always supposed to keep the names of objects (brush,
pattern, font etc.) around even if these objects don't exist, for
cases like refreshing the data in a GimpDataFactory (which worked
fine), but also for deserializing the names of objects which don't
exist *yet* (delayed loading, no-data or whatever).

This commit fixes the delayed loading case (particularly affects fonts):

gimp_context_deserialize_property(): always keep the name of the
object around when it is not found, not only in the no-data case.

gimp_context_copy_property(): always copy the object *and* its name to
the dest context.

Add GimpConfig::duplicate() and ::copy() implementations which chain
up for duplicating/copying all properties and additionally copy all
object names to the new/dest context.
2018-06-17 14:09:55 +02:00
Michael Natterer b3690b48d9 app: add GIMP_CONTEXT_PROP_MASK_TOOL_PRESET to GIMP_CONTEXT_PROP_MASK_ALL
It seems it was simply forgotten. PROP_MASK_ALL is used at some very
central places, so this commit might fix a few subtle bugs, or
introduce new ones, everybody look for strange tool preset behavior
please :)
2018-06-17 13:37:08 +02:00
Jehan 0af3ae81ff app: also search interpreters executable in $PATH.
Same as we did for binfmt-style lines, if the executable part (for
instance in `pygimp.interp`) is not an absolute path, let's allow
ourselves to find it in the environment $PATH.

(cherry picked from commit f3c5ed55c8)
2018-06-16 03:23:05 +02:00
Félix Piédallu 15075932be Fix Python files:
* Prefer python2 to python that may point on python3 on modern installs.
* Fix indent/spaces consistency.

(cherry picked from commit 2265701268)
2018-06-16 02:57:06 +02:00
Jehan 3c6f789ca5 plug-ins: recognize "python2" env to launch the python interpreter.
(cherry picked from commit 769325e51b)
2018-06-16 02:57:06 +02:00
Jehan 42b13216fc m4macros, plug-ins: run more accurately the "python2" interpreter.
Our configure test checks the presence of a Python2, but then uses
"python" as interpreter, which is a problem nowadays as the default
python is set to be Python 3 on some distributions (and this will be
more and more the case). So GIMP may end up trying to run our plug-ins
through Python 3 (which would fail) even if Python 2 is present.
Now AM_PATH_PYTHON2() m4 macro will set $PYTHON to a more accurate
Python version as priority.

Similarly let's use "python2" in the binfmt string for extension search.

(cherry picked from commit 03ea9cac54)
2018-06-16 02:07:02 +02:00
Jehan c0cc5abe36 app: gimp_interpreter_db_add_extension() should check $PATH if needed.
So basically our binfmt set for Python simply never worked since we just
set 'python' and not a full path, but current code was not looking in
the $PATH environment. This was dead code. Now it's fixed.

(cherry picked from commit 6080178a39)
2018-06-16 02:07:02 +02:00
Jehan 51a8ff9c37 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.

(cherry picked from commit 8509117fe6)
2018-06-16 02:07:02 +02:00
Ell 1516bfc14b 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.
2018-06-15 16:04:20 -04:00
Ell 6a3fc6c1b9 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.
2018-06-15 16:04:20 -04:00
Salamandar 02edd1c8eb Specify utf-8 for rc file. 2018-06-15 17:35:00 +00:00
Salamandar 8feb51954b Fix encoding. The world should be utf-8. 2018-06-15 17:34:59 +00:00
Jehan 79d55e09e4 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.

(cherry picked from commit 130ef5ce59)

Note: it is untested on master since we don't have Python right now, but
I don't see why it would not work here as well!
2018-06-15 18:44:27 +02:00
Jehan 276d9b60b3 configure, tools: actually use GIMP_PKGCONFIG_VERSION and...
... GIMP_TOOL_VERSION rather than hardcoding versions.
We may still have issues with "gtk+-3.0", but let's let this one slip
for now.
2018-06-15 17:22:38 +02:00
Jehan 10480ef7c6 tools: gimptool should check gimp*-3.0 pkg-config file.
And "gtk+-3.0" as well.
Thanks to Benoit Touchette for noting.
2018-06-15 16:47:05 +02:00
Ell 58c96f596e 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.
2018-06-15 08:19:47 -04:00
Michael Natterer 756fed0cc2 Issue #1450 - Transform tools don't add an alpha channel in 'None' interpolation
Never add an alpha channel in gimp_layer_real_transform(), it was only
added because our pre-GEGL transform code was shit. This is quite the
opposite of what the bug reporter asked for, but IMO the more correct
fix.

This will NOT go to 2.10 because it changes behavior.
2018-06-15 11:33:10 +02:00
Simon Mueller 541f730f44 plug-ins: use g_fopen(filename, "w+b")...
...because g_fopen(filename, "wb+") fails on Windows.
2018-06-15 11:00:35 +02:00
Michael Schumacher c93727e791 plug-ins: use g_fopen(filename, "w+b") instead of "wb+" to fix SGI format export on the Microsoft Windows platforms 2018-06-15 07:59:43 +00:00
Ell d3a3c35317 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).
2018-06-15 01:59:40 -04:00
Ell e15733236c 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.
2018-06-14 19:51:27 -04:00
Ell 47b7e7be7d 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.
2018-06-14 12:33:41 -04:00