Commit Graph

40405 Commits

Author SHA1 Message Date
Jehan cdabe69164 Bug 794469 - Shift-click-create layer always set "Default/Normal" mode.
It should use the last used layer mode instead.
2018-03-23 18:46:21 +01:00
Michael Natterer 2c417801fc app: fix error message in gimp_text_buffer_save() 2018-03-23 14:47:14 +01:00
Michael Natterer 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Jehan 3df168595e NEWS: keep up-to-date. 2018-03-23 01:30:58 +01:00
Jehan 25af765fe6 app: output a dialog to recover images salvaged after a crash.
Since commit d916fedf92, GIMP has had the hidden feature to salvage
images (if possible) during a crash into a backup folder. This commit
finishes the feature by opening a dialog proposing to try and recover
the salvaged images.
This is not perfect yet since it doesn't "remember" the XCF path (in
case it was a previously saved image). The images open as new unsaved
and dirty images, but directly from the contents at crash time. For now,
it is up to people to figure out what they correspond to, if relevant.
2018-03-23 00:57:56 +01:00
Ell 289ecebd69 Bug 793734 - White alpha border after upscaling
In gimp_gegl_apply_scale(), use a CLAMP abyss policy for the scale
op, to avoid leaking transparency into the image when scaling
drawables.

Note that this (intentionally) only affects whole-image/layer
scaling, and not scaling done using any of the transform tools.
2018-03-22 17:04:13 -04:00
Ell ab4b7ab33a app: crop input to output rect in channel ops
In gimp_gegl_apply_{border,grow,shrink,flood}(), which are used
by the corresponding channel functions, pass crop_input = TRUE to
gimp_gegl_apply_operation(), to clip the input to the output rect.

These operations process the entire input in one go, regardless of
the requested output region; however, the channel functions
calculate the output region according to the known channel bounds,
hence clipping the input to these bounds doesn't affect discard any
information, while avoiding unnecessary work.  In particular, this
makes the corresponding operations on small selections in big images
much faster.
2018-03-22 13:46:28 -04:00
Ell e1b1611ec4 app: add crop_input parameter to gimp_gegl_apply_operation()
Add a crop_input parameter to gimp_gegl_apply_[cached_]operation().
When TRUE, the functions crop the op's input to the destination
rect.  This is particularly useful for functions that process the
entire input in one go (by means of get_cached_region()).  See the
next commit.

Pass crop_input = FALSE at all call sites for now, to keep the
current behavior.
2018-03-22 13:46:28 -04:00
Jehan 4580285503 app, NEWS: metadata export settings are now ON by default.
After many discussions, it has been decided to export the metadata by
default since it seems to be what many people would expect and they
would consider they "lost" metadata (especially if they overwrite their
original). I don't entirely agree since privacy (particularly if you are
not aware of metadata and information they may contain) is also an issue
but not many seem to agree with me.
So here it is! All metadata now exported as a default!
2018-03-22 15:48:21 +01:00
Jehan 848b89afc2 autogen: add support for recent automake 1.16. 2018-03-22 13:26:43 +01:00
Jehan f497287837 app: only show FATAL errors by default for stable releases.
The debug dialog is awesome and extremely helpful, but I realize it may
be a better default experience on *stable* to raise it only in case of
crashes. CRITICAL are bad and should be fixed, but sometimes their
consequence is actually not visible except for this dialog, and people
on stable builds may prefer not to see this dialog. Also we will likely
get a lot of duplicates for the same bugs once everybody has this by
default, which will be very annoying to attend to, unless we had
automation (which we don't right now).
The option is still available in preferences anyway so people really
interested in helping can activate the option for CRITICAL and even
WARNING anyway, even on stable releases.
2018-03-22 13:23:11 +01:00
Michael Natterer 829d44d900 app: make "color" parameter of gimp_palettes_add_color_history() const 2018-03-21 19:10:55 +01:00
Michael Natterer 9a365eaf8b Bug 794378 - GIMP crashed while I was moving the image window
Use a weak pointer in GimpToolGui to not keep a dangling
private->viewable around.
2018-03-20 19:02:43 +01:00
Jehan c44f5a2f4c NEWS: keep up-to-date. 2018-03-20 17:33:19 +01:00
Jehan 34b68a2c1d plug-ins: rename s/YUV/YCbCr/ s/eYCC/xvYCC/ s/RGB/sRGB/.
Exchanging with OpenJPEG developers and searching more on the topic, it
seems that YUV is more often refered to as YCbCr. Wikipedia says:

> typically the terms YCbCr and YUV are used interchangeably, leading to
> some confusion. The main difference is that YUV is analog and YCbCr is
> digital

As for eYCC, I am told this is extended YCC. It seems this is refered as
xvYCC (I really can't find much under "eYCC"). So let's rename it too.

Hopefully I made no mistakes!
2018-03-20 17:09:31 +01:00
Jehan 5732b7ab6d plug-ins: add a color space parameter to file-j2k-load().
JPEG 2000 codestream doesn't have a header and guessing the color space
in particular is not foolproof (especially when 3 or 4 components, which
can be many spaces). Therefore the need of a parameter on the API.

Note that JP2 images should always have the color space information. In
interactive mode, I try to be a bit flexible to salvage broken JP2 with
no color space information in the header, but I am not adding a
parameter in file-jp2-load() (on purpose, since we are not going to add
in the API a parameter for a case not supposed to happen with properly
encoded files).
2018-03-20 16:52:04 +01:00
Jehan 7e52c48364 plug-ins: open a dialog to select color space of JPEG 2000 codestream.
JPEG 2000 codestream (.j2k/.j2c) are only compressed code stream data,
without header. In particular we don't have color information, such as
the color space. So we need to open a dialog asking to set the color
space in interactive mode.

Note: according to OpenJPEG developers, a JP2 image (not codestream)
should always have a color space defined in its header. But just to be
flexible, the same dialog may get raised as well if we try to load a JP2
with no valid color space defined in header and no ICC profile embedded.
Maybe if such a thing happened, it means the image is corrupt, yet we
may as well try and salvage it anyway.

Note 2: I also removed a weird test which was setting some images as
being YUV color space by mistake. This actually fixes bug 794413 as a
side effect.
2018-03-20 14:50:23 +01:00
Jehan 5e5fa4a024 plug-ins: .jpc is another known extension for JPEG 2000 codestream.
Even though I haven't seen working samples with this extension,
according to some references, this is a common extension for compressed
JPEG 2000 code stream. Also our old plug-in was listing this extension,
so let's do so now as well.

To this day, the only 2 extensions we used to list in the JasPer-based
plug-in and not in the OpenJPEG one are .jpf and .jpx (JPEG 2000 Part-2)
since OpenJPEG does not have support yet. But actually I think the old
plug-in may have simply been "lying" since JasPer website says the
library is meant to implement JPEG-2000 Part-1 standard.
So I believe we are now on par (and even better on many aspects) with
the former plug-in implementation based on libjasper.
2018-03-20 02:05:49 +01:00
Michael Natterer 28d9e43f53 Bug 792686 - Colormap widget not updated when adding entry
gimp_image_add_colormap_entry(): increment private->n_colors *before*
calling gimp_image_colormap_set_palette_entry() so it actually adds an
entry.
2018-03-20 00:53:57 +01:00
Michael Natterer 8447e775ab Bug 783680 - Allow to hide color models in GimpColorScales
Redo the entire thing again:

- Rename the values of enum GimpColorSelectorModel to include "MODEL"
- Change GimpColorSelector API from set_model() to set_model_visible()
  so visibility of each model can be toggled individually and is not
  exclusive any longer
- The GUI is back to what it was before, except that the "GIMP" page
  now honors the model visibility and has a resonable minimum height
2018-03-19 23:11:27 +01:00
Jehan 8f71aeda3d build: update flatpak builds with latest changes.
Untested. Hopefully should build.
Also bump the GNOME runtime to the latest version.
2018-03-19 17:42:49 +01:00
Jehan 845eb522b6 Bug 793777 - CRITICALs on focus change in MWM with stylus.
Focus change events were expecting the current tool control to be
inactive, which was the case most of the time. Yet with stylus, the
canvas was sometimes receiving GDK_BUTTON_PRESS events before
GDK_FOCUS_CHANGE. In particular the canvas was receiving a button press
before the focus out, then button release and focus in. Therefore by the
time the focus out event happens, the tool control is active, which
broke a few calls.
Therefore I add a few checks and returns immediately when
gimp_tool_control_is_active() return TRUE, especially since we also run
gimp_display_shell_update_focus() calls after a button press anyway so
the state should already be consistent.
2018-03-19 15:30:41 +01:00
Ell cada28e91e app: reset GimpFilterTool widget when resetting settings
Add a gimp_filter_tool_reset_widget() function, which resets the
tool widget associated with the filter's controller -- i.e., it
resets those properties of the widget that aren't controlled by the
op's properties to some "default" state.  For most controller types
this is a NOP; for transform-grid controllers, we move the pivot
back to the center of the drawable, w.r.t. the current transform.

Call gimp_filter_tool_reset_widget() after resetting or reloading
the tool's config.
2018-03-18 14:35:11 -04:00
Michael Natterer 7ca38c54f6 Bug 794366 - Crash when using Hue-Chroma on a ProPhotoRGB image
Handle "CIE LCH(ab)" in gimp_color_profile_get_lcms_format() as
suggested by Massimo.
2018-03-18 18:48:12 +01:00
Piotr Drąg a1d5978826 Update Polish translation 2018-03-18 17:51:33 +01:00
Massimo Valentini 16b0110f72 Bug 791315: Using the Gaussian Blur filter twice (Re-Show)...
...only remembers horizontal radius, duplicates it for vertical

Keep a list of the GUI's chain buttons around. When changing the
entire config object like on reset or selecting saved settings, unlik
them all after remembering their "active" state, and after changing
the settings activate the ones that were active before, but only if
the values they link are still the same.
2018-03-18 17:39:03 +01:00
Jehan a1b4f4aef5 Bug 793638 - (gimp-edit-stroke ...) crashes gimp-console-2.9 unless...
... (gimp-context-set-paint-method...) is called.
GimpContext initialized with standard paint info at constructed() time
to ensure there is always a paint_info even if none were set manually.
2018-03-18 15:07:50 +01:00
Michael Natterer 753bd0a0c9 pdb: add jehan_pdb_misc() and use it in the new procedures
so they have the correct aithor.
2018-03-18 13:57:43 +01:00
Jehan 1789f0fe2a app, libgimp, pdb: update gimp_edit_blend() description.
Make it known that gimp_context_set_distance_metric() influences the end
render of a shapeburst blend.
2018-03-18 13:21:05 +01:00
Jehan c5c0dbcd24 NEWS: keep up-to-date. 2018-03-18 01:16:13 +01:00
Jehan e164aee7a9 app, libgimp, pdb: add "distance-metric" property to GimpPDBContext.
This property is currently only used for gimp_edit_blend() to control
how are computed distances. In the future, it could be used for more
functions making use of "gegl:distance-transform" operation, or even for
other algorithms, if relevant.
This new property obviously comes with 2 new PDB calls:
gimp_context_get_distance_metric() & gimp_context_set_distance_metric()
2018-03-18 01:03:40 +01:00
Jehan 11dcabc46f pdb: prepend GEGL enum types with GEGL_TYPE.
Since now we can also support some GEGL type in the PDB, this completes
commit 390ef44481 for proper support.
2018-03-18 00:36:04 +01:00
Michael Natterer 390ef44481 pdb, libgimp: allow to use external GType-registered enums in the PDB
The enums have to be menually registered in pdb/enums-external.pl.
Currently supports enums from GEGL only.

Add enum GeglDistanceMetric as first external enum.
2018-03-17 20:31:48 +01:00
Jehan c3ef34b496 Revert "app: "distance-metric" is now a property of GimpContext."
This reverts commit 2c799d4af9.
Ok. I misunderstood Mitch. This belongs in GimpPDBContext.
2018-03-17 20:05:54 +01:00
Jehan 2c799d4af9 app: "distance-metric" is now a property of GimpContext.
Remove the property from Blend tool and make it use the context one.
2018-03-17 18:18:56 +01:00
Jehan d25db86fc9 NEWS: keep up-to-date. 2018-03-17 16:54:08 +01:00
Jehan 1eedbdc942 desktop: <release> tag texts for upcoming 2.10 reworded a bit. 2018-03-17 16:31:47 +01:00
Jehan acc0a97eed app: updating the previous commit following enum update in GEGL.
Enums have been renamed to s/GEGL_DISTANCE_FOO/GEGL_DISTANCE_METRIC_FOO/
Make the change in GIMP too.
2018-03-17 16:19:31 +01:00
Jehan 9b11fb2b91 app, libgimp, libgimpbase, pdb: s/GimpDistanceMetric/GeglDistanceMetric/
GeglDistanceMetric has just been added as a public enum in GEGL. Basing
our code on this, and getting rid of the newly added GimpDistanceMetric.
2018-03-17 14:57:31 +01:00
Jehan f2c80e1878 plug-ins: coding style cleaning.
Trailing whitespaces here and there, alignment issues, and so on…
Also get rid of an unused variable.
2018-03-16 22:08:40 +01:00
Darshan kadu a9a3a67cf2 plug-ins: 16/32 bit JPEG2000 support. 2018-03-16 21:39:08 +01:00
Jehan 4fdf301dea plug-ins: properly check widget class holding tag data.
Some tag data is hold in GtkEntry, other in GtkTextView, which are not
parent to each other. Previous checks were wrong and resulted in
"invalid cast from 'GtkEntry' to 'GtkTextView'" WARNINGs (followed by
many CRITICALs because of this first error).

Also properly free the data returned by gtk_text_buffer_get_text() which
is allocated (unlike strings returned by gtk_entry_get_text() which must
not be freed).
2018-03-16 20:20:24 +01:00
Jehan 8aaf77ba11 app: return from gimp_display_shell_space_pressed() immediately when...
... scrolling in progress.
In particular, this could happen while panning with mouse middle click
and hitting space. This space should simply be ignored.
2018-03-16 19:52:16 +01:00
Ell 9c663a6574 libgimpcolor: fix gimp_color_profile_get_lcms_format() for premul formats
It doesn't look like LCMS supports premultiplied alpha formats, so
we must convert them to the corresponding non-premultiplied formats
ourselves.
2018-03-16 12:48:51 -04:00
Jehan 6c8300923d Bug 779942 - Make GimpPickButton honor monitor profile.
Quartz/macOS implementation for the color picker.
This is untested but I am trying to advance our 2.10 blockers by
implementing the base code for this feature. Please anyone with macOS
machine access, review and fix if needed!
2018-03-16 17:17:54 +01:00
Jehan b279c2d217 Bug 724692 - Canvas rotation stuck with specific order of actions.
The bug was affecting actually both canvas rotation and panning when
done with space key. If the first mouse button was also clicked, then
released after the space key, we ended up in some stuck action. It could
only be unstuck by hitting/releasing space again.

I am actually unsure that this was not originally done on purpose,
especially since the code has these 2 status variables space_pressed and
space_release_pending, but really apart from looking at this code, the
behavior just looks very buggy and impracticable.
The new behavior is to just stop the canvas panning/rotation as soon as
space is released (which is also how it is documented in our manual, and
how everyone seems to use the feature). I only kept the variable
space_release_pending, which I use as was used space_pressed before.
2018-03-16 14:23:41 +01:00
Ell dc1852049e app: throttle GimpCanvasProgress updates
Avoid redrawing GimpCanvasProgress items upon
GimpProgress::set_value() if a minimal amount of time hasn't passed
since the last call.  This notably improves performance of
frequently-updated GimpCanvasProgress items.
2018-03-16 04:34:00 -04:00
Ell 1cc90e52bb app: fix indentation in gimpcanvasprogress.c 2018-03-16 04:34:00 -04:00
Ell 9799803fae libgimpbase: add gimp_distance_metric_get_type() to .def file 2018-03-15 18:02:22 -04:00
Jehan c5a0189b7f libgimp, pdb: some generated files which were not in previous commits.
It's weird. I didn't see these when I added the GimpDistanceMetric enum
type. Not sure why. Adding these now.
2018-03-15 15:05:32 +01:00