Commit Graph

45543 Commits

Author SHA1 Message Date
Jehan 05556457df plug-ins: remove last usage of GTimeVal and g_get_current_time().
Deprecated as not year-2038-safe, this was the last remnant of code
which was still using it.
2020-04-14 16:08:38 +02:00
Yuri Chornoivan db35080e75 Update Ukrainian translation 2020-04-14 12:35:25 +00:00
Jehan f6dd30f3a8 plug-ins: fix more abs().
I am comparing absolute value of 2 double computation results. Might as
well just use fabs() instead of truncating both values to int.
Fixes the following:
> warning: using integer absolute value function ‘abs’ when argument is
> of floating point type ‘double’ [-Wabsolute-value]
2020-04-14 00:12:45 +02:00
Jehan fddaa77218 plug-ins: fix abs() on long int.
Fixes the following bug:

> warning: absolute value function ‘abs’ given an argument of type
> ‘glong’ {aka ‘long int’} but has parameter of type ‘int’ which may
> cause truncation of value [-Wabsolute-value]
2020-04-13 23:18:19 +02:00
Jehan b71754f2a7 plug-ins: fix some build warning.
Fixes:
> warning: using integer absolute value function ‘abs’ when argument is of floating point type ‘double’ [-Wabsolute-value]
2020-04-13 21:54:09 +02:00
Jehan ea0cc27c01 app, libgimp, pdb: update gimpfile PDB functions' documentation.
All file-related functions now uses a single GimpFile as argument.
Comments regarding path as entered vs full pathname are now obsolete.
2020-04-13 20:25:32 +02:00
Jehan 60854c8668 gitlab-ci: libspiro is needed to run `gegl`.
`gegl` binary is being run for icon generations on gimp-2-10.

(cherry picked from commit 97549081fd)

Note: this commit is so far not needed on master as we don't call gegl
during build time unlike in gimp-2-10. But we could at some point.
Better to be thorough.
2020-04-13 14:55:10 +02:00
Jehan afd2b81dbf build: proper libmypaint v1 development branch is now libmypaint-v1.5.x.
Development switched to this branch since v1.5.0 release.
2020-04-13 12:25:35 +02:00
Ell 0096e563f6 app: apply "trc" setting when repeating curves and levels
In gimp_operation_config_sync_node(), when the operation has a
property of the config object's type, don't skip the other
properties.  This makes sure to set the "trc" property of
GimpOperation{Curves,Levels} according to the config object.  We'd
previously done it manually in GimpFilterTool, but the setting was
not applied when repeating the filter.
2020-04-13 02:03:40 +03:00
lillolollo 202012ba73 plug-ins: screenshot-win32.c forbids mixed declarations and code
(cherry picked from commit 09fb64c604)
2020-04-12 19:39:30 +00:00
Piotr Drąg 472069779a Update Polish translation 2020-04-12 10:32:58 +02:00
Sabri Ünal 60b6c06638 Update Turkish translation 2020-04-10 17:48:43 +00:00
Jordi Mas 6cc47a7af0 Update Catalan translation 2020-04-10 16:03:29 +02:00
Jordi Mas 32d00fd0e0 Fixes to Catalan translation 2020-04-10 14:43:09 +02:00
Jordi Mas b2f21ded85 Update Catalan translation 2020-04-09 22:17:23 +02:00
Ell 9099f317bc plug-ins: add support for exporting 16-bit PSDs
In file-psd, add support for exporting high bit-depth images.  This
is currently limited to 16-bit images, since 32-bit images seem to
have a different structure (our loading code can successfully load
32-bit images exported by the plug-in, but not actual 32-bit PSD
files saved in Photoshop.)  Higher bit-depth images are saved as
16-bit for now.

Note also that when saving a linear image with a built-in linear
profile the result is wrong (the image is exported with a linear-
TRC profile, but the data is perceptual), but this is a general
problem we have to fix, not restricted to the PSD plug-in.
2020-04-09 01:17:56 +03:00
Jordi Mas 0d4a9b7ca4 Update Catalan translation 2020-04-08 22:49:13 +02:00
Jehan de6eacd524 build: build json-c with CMake.
json-c has 2 build systems (autotools and CMake) and it seems their
autotools broke with recent changes. I will report upstream. For the
time being, we may as well switch to CMake build.
2020-04-08 21:31:57 +02:00
Jehan 809e79f37a Issue #4919: PDF: Order of pages reversed when opening and closing.
Let's go with the logics "bottom layer is first", which is also the
logics in animated formats. Hence changing the layer order on loading
multi-page PDF.
2020-04-08 20:08:00 +02:00
Ell 38059dc5fd app: rename "Fade" section of GimpFilterTool to "Blending Options"
... and GIMP_LAYER_MODE_CONTEXT_FADE to
GIMP_LAYER_MODE_CONTEXT_FILTER.
2020-04-08 15:59:33 +03:00
Ell 4932beb302 app: fix last commits 2020-04-08 01:04:29 +03:00
Ell 7b46a8be45 app: exclude GimpSettings::time property from comparison
As per last commit, explicitly exclude the GimpSettings::time
property from comparison.
2020-04-08 00:26:45 +03:00
Ell 46df3642d2 libgimpconfig: in gimp_config_type_register(), don't override GimpConfig::equal()
gimp_config_type_register() currently overrides GimpConfig::equal()
to only compare the properties of the most-derived type.  However,
this prevents the properties of GimpOperationSettings from being
considered during comparison of operation-config objects.  Instead,
don't override GimpConfig::equal(), and rely on
GIMP_CONFIG_PARAM_DONT_COMPARE to exclude specific base-class
properties from comparison.
2020-04-08 00:22:49 +03:00
Ell c5c807d191 libgimpconfig: add GIMP_CONFIG_PARAM_DONT_COMPARE flag
... which excludes a property from comparison in the default
implementation of GimpConfig::equal().
2020-04-08 00:10:42 +03:00
Ell d25cddae8c app: add gimpoperationsettings.c to meson.build 2020-04-07 20:11:53 +03:00
Ell ddd3199e02 app: in filter tools, remember state of the fade and color-options expanders
In GimpFilterTool, remember the last expanded state of the color-
options and fade expanders.
2020-04-07 19:40:06 +03:00
Ell 8384d37e66 app: add "Fade" options to filter tools
As per commit ed7ea51fb7, reintroduce
the "Fade" functionality for filters, by incorporating it directly
into GimpFilterTool.

Add "mode" and "opacity" options to GimpOperationSettings, and add
a corresponding "Fade" expander to the GimpFilterTool dialog
allowing to control them.

Reintroduce the FADE layer-mode context, and use it to mark the
layer modes avaialable for fading.
2020-04-07 19:40:05 +03:00
Ell c81cb59e4e app: apply common operation settings when reapplying a filter
Add a new gimp_drawable_apply_operation_with_config() function,
which takes an operation node together with a config object, and
applies the operation using the config options, including both the
operation-specific options, and the common GimpOperationSettings
options.

Use the function in gimp_gegl_procedure_execute(), so that
reapplying a filter takes the common operation settings used
originally into account.
2020-04-07 19:39:53 +03:00
Ell b4afe6e7a6 app: in GimpFilterTool, store common settings in GimpOperationSettings
Remove the common operation settings from GimpFilterOptions, and
instead, in GimpFilterTool, store these settings in the operation's
config object, which is now a GimpOperationSettings subclass, as
per last commit.
2020-04-07 19:39:51 +03:00
Ell a1ff1601ee app: add GimpOperationSettings
Add a new GimpOperationSettings class, to be used as a base class
for all operation-config types.  The class provides options common
to all operations (namely, the clipping mode, input region, and
color options), which were previously stored in GimpFilterOptions,
and were therefore bound to the filter tool, instead of being
stored as part of the operation settings; as a result, these
options would have no effect when reapplying a filter, or when
restoring a preset.

The GimpOperationSettings options do not affect the operation
node, but rather the associated GimpDrawableFilter object.  The
class provides a gimp_operation_settings_sync_drawable_filter()
function, which applies the options to the filter.

Modify all custom and auto-generated operation-config types to
derive from GimpOperationSettings, and modify the GimpConfig
functions of the former to account for the GimpOperationSettings
properties, using a set of protected functions provided by the
class.
2020-04-07 19:26:28 +03:00
Ell 8c619bf0b2 app: add gimp_gegl_node_has_key()
... which determines if a node's operation-class has a specific
key, and can be used instead of gimp_gegl_node_get_key() when only
existence is important, to avoid compiler warnings.

Update the rest of the code to use the new function.
2020-04-07 19:02:18 +03:00
Ell 9947093d02 app: use gimp_drawable_supports_alpha() in GimpDrawableFilter
... instead of GIMP_IS_LAYER()
2020-04-07 19:02:17 +03:00
Ell 0ade474286 app: use gimp_drawable_filter_get_format() in GimpFilterTool
... to set the visibility of the clipping-mode combo based on the
filter's actual output format, instead of the drawable format.
2020-04-07 19:02:17 +03:00
Ell 9aee8744dc app: add gimp_drawable_filter_get_{drawable,operation,format}()
... which return the filter's drawable, operation, and output
format, respectively.
2020-04-07 19:02:16 +03:00
Jordi Mas 3f66f2df39 Fixes to Catalan translation 2020-04-05 20:49:33 +02:00
Jordi Mas bd1326fd53 Update Catatalan translation 2020-04-05 20:24:32 +02:00
Piotr Drąg 3c10f1cfc6 Update Polish translation 2020-04-05 12:20:56 +02:00
Yuri Chornoivan c1cc5ade2e Update Ukrainian translation 2020-04-05 09:24:04 +00:00
Jehan 023919d606 app: make version + revision string translatable.
Also add some comment for translators on this string and another.
Thanks to Piotr Drąg for commenting on these.
2020-04-04 16:38:19 +02:00
Jehan 97a0ad3fec build: sync development flatpak manifest with stable one. 2020-04-04 01:10:55 +02:00
Jehan cb731fd873 app: fix drag'n drop viewable description.
In GTK+3 GIMP, without a "width-chars" even short layer names (a few
letters) were always ellipsized to nothingness with the "ellipsize"
property.
So add a reasonable prefered width char (which will be at most 10
characters, less if the layer name is smaller).

Also drop "xpad" property as this is now deprecated.
2020-04-04 00:57:40 +02:00
Jehan 291af71e95 plug-ins: do not use strcpy() when src and dest overlap.
I don't reproduce these build warnings in my build but frogonia reported
them:

> warning: 'strcpy' accessing 1 byte at offsets 0 and [0, 2147483645] may overlap 1 byte at offset 0 [-Wrestrict]

And indeed the man of strcpy() clearly states that "The strings may not
overlap" (which is clearly not guaranted in current code as we don't
know the size of what's after the substring).
strncpy() might have done the trick as it doesn't say anything about
possible overlap or not, but let's just use memmove() instead where it
is clearly written that memory areas may overlap (note that bcopy() as
proposed by ankh would have also done the trick, but it is marked as
deprecated).
2020-04-04 00:48:36 +02:00
Jehan 105c4efc8b Issue #4487: change "Save color values from transparent pixels"…
… defaults to FALSE for PNG, TIFF.
The logics is that in most case, when alpha is 0, you don't expect color
to be retrieved and some people were bothered by this when erasing data
with eraser tool or selection deletion.

For the WIP image as well as for XCF format, we definitely want to keep
color data as there are workflows where you would want to erase/unerase
pixels subtly (selection also are not binary and should not be expected
to erase color data on layers with alpha channel). So we want to keep
the non-destructive behavior there.
Yet for export formats, going for "deleting what looks deleted" is a
valid approach, especially as it has been argued that experienced users
would know how to read and change the format options (and these
experienced users are likely the ones who may have valid reasons to want
pixels with full transparency to keep color values).
PNG and TIFF were the only 2 formats where I see such options, so
changing the default for these 2 plug-ins.
2020-04-03 20:04:26 +02:00
Jehan cc16ec5f9f Issue #4904: GIMP startup SLOW due to failed access to…
… oscp-router0[12].gnome.org.

The file was opened asynchronously through g_file_read_async() but the
actually reading from a GFileInputStream was actually done in the
callback, in the main thread. So it may be possible that file is
accessible but connection is very slow or non-reliable and actual
reading would block the main process. I am assuming this is what may
have happened for this reporter.

Instead let's use g_file_load_contents_async() which does the file
opening, reading and closing all in the asynchronous task, hence would
not slow down anything even if the remote resource is unavailable or
connection is very slow.
2020-04-03 19:32:26 +02:00
Ell 6bae5d8cf7 Issue #4895 - Crash when dragging a dockable dialog
Apparently, the "drag-begin" signal of dockbook tabs can be raised
multiple times when a drag begins (this seems to happen randomly,
and rarely -- possibly a GTK bug).  In
gimp_paned_box_drag_callback(), which gets called in response, make
sure not to leak the corresponding idle source in this case, which
can lead to a segfault if the widget is destroyed before the idle
is run.
2020-04-03 20:05:13 +03:00
Ell 491dc85242 app: add missing changes to last commits 2020-04-02 19:18:04 +03:00
Ell 912b36a8f8 app: don't detroy cached data when disabling filter-tool preview
In GimpFilterTool, use gimp_drawable_filter_set_preview(), added in
the previous commit, to toggle the filter's preview, instead of
removing and re-adding the filter.  This avoids destroying cached
results when disabling the preview, allowing to quickly toggle the
preview on and off to compare the result.
2020-04-02 19:04:42 +03:00
Ell 7ec033d896 app: add gimp_drawable_filter_set_preview()
... which allows enabling/disabling the filter's preview, without
destroying cached data.
2020-04-02 18:56:02 +03:00
Ell 616530e235 app: rename gimp_drawable_filter_set_preview() to _set_preview_split()
... in preparation for next commit.

Update GimpFilterTool accordingly.
2020-04-02 18:55:18 +03:00
Ell e324e2d4b3 app: add gimp_applicator_set_active()
... which allows temporarily turning the applicator into a NOP,
without destroying cached data.

This commit also improves gimp_applicator_set_{src,dest}_buffer().
2020-04-02 18:54:18 +03:00