Commit Graph

47577 Commits

Author SHA1 Message Date
Jehan 2ddc2ab7be plug-ins: some cleanup in file-webp.
- use g_file_peek_path() instead of g_file_get_path() in various places.
  Less prone to memory management bugs (not forgetting to free in all
  cases). Also it is often more efficient, especially for local files
  where the _peek_ variant does not even need to allocate any memory as
  path is already hanging around (and local files are the most common
  use cases, I believe!).
- Also gets rid of one GFile creation with g_file_new_for_path() from
  the path returned from another GFile! We can just use the same GFile
  as it is not freed and perfectly usable.
2021-10-01 18:47:30 +02:00
Hugo Carvalho 216a4bcfe2 Update Portuguese translation
(cherry picked from commit 0b7e5802c8)
2021-10-01 13:08:50 +00:00
Hugo Carvalho cec3c3a159 Add Portuguese translation 2021-10-01 12:53:57 +00:00
Matej Urbančič e3d9852839 Update Slovenian translation 2021-10-01 12:20:17 +00:00
Matej Urbančič bb1efa6290 Update Slovenian translation 2021-10-01 12:20:02 +00:00
Daniel Novomesky ea6bcef360 Fix missing return in file-jpegxl.c 2021-10-01 11:00:03 +00:00
Jehan fd9f96f174 app: get rid of a wrong return-after-free report.
Reported by Massimo, though this one is wrong, as far as I can see.

`ninja scan-build` apparently reports `result` as being returned after
being freed here. But actually since we are setting the `error` with
g_set_error() in the same time we free `result`, we would also enter the
`if (*error)` block a few lines later, which would return NULL and not
`result` anyway. I guess the static analyzer could not see that far.

Still, set the pointer to NULL with g_clear_pointer(), which should be
enough to make the static analyzer happy.
2021-10-01 12:51:48 +02:00
Jehan 22f234e5b0 libgimpwidgets: do not free cache before using it for debug output.
Thanks to Massimo for noticing this use-after-free bug.
2021-10-01 12:25:34 +02:00
Jehan 545257226a plug-ins: use g_file_peek_path() instead of g_file_get_path().
Freeing the path immediately could lead to a free-after-use error as we
used it for an error message when the file pointer failed to be created,
as reported by Massimo (thanks again!).

Using g_file_peek_path() has also other advantages, such as being less
error-prone, but also possibly more efficient. First looking at the
implementation, for local files, we already have the path around, so no
additional memory allocation even needs to happen. As for the generic
code path, it would still allocate a new string, yet cache it and reuse
it when needed later. This makes the _peek_ call much better for quick
peek-use-discard usage.
2021-10-01 12:20:36 +02:00
Jehan e01c37c3dd plug-ins: fix wrong data freeing.
`filename` was being leaked while `file` was not to be freed yet.

Thanks to Massimo for noticing.
2021-10-01 11:47:27 +02:00
Jehan 2da70b3fb7 build: CC="cache gcc" breaks gobject-introspection for native win build.
After some recent patch added to Python on MSYS2, in the same time as
they bumped from Python 3.9.6 to 3.9.7, our native Windows build started
breaking.

This patch modified `cygwinccompiler.py` to use CC environment variable
as being necessarily a single executable whereas if it were made of 2
commands (such as "ccache gcc"), the call was failing because the code
now tries to find a single command with this name (as though the space
belongs to the file name).

Therefore the line:
>   File "C:/msys64/mingw64/lib/python3.9/distutils/cygwinccompiler.py", line 451, in is_cygwincc
>     out_string = check_output([cc, '-dumpmachine'])

Resulted in the error:
> FileNotFoundError: [WinError 2] The system cannot find the file specified

For now, let's just not set ccache this way, even though this method is
normally meant to work and is one of the 2 officially proposed methods
(the other being to use symlinks named as compilers in priority in
PATH).
Also I'm not even sure ccache is useful at all right now (is cache
finally stored/reused between CI runs? I remember we tried to make it
happen, but I can't remember if we really had this properly in the end).

See: https://github.com/msys2/MINGW-packages/issues/9677
2021-10-01 02:09:16 +02:00
Niels De Graef b61dd873d5 meson.make: Don't use backend-specific calls
There's always a possibility that someone wants to use meson with
something else than `ninja` (in theory, since this is the only supported
backend atm). It also means less commands to remember for newcomers.
2021-09-30 16:13:35 +02:00
Niels De Graef 7ee72ee9f7 flatpak: Use fallback-x11
From Flatpak's NEWS:

> A new fallback-x11 permission grants X11 access, but only if the user
> is running in a X11 session. For applications that support both
> Wayland and X11, this can be used to ensure that the app doesn't have
> unnecessary X11 access while in Wayland, but still works in an X11
> session.
2021-09-30 16:10:09 +02:00
Stanislav Grinkov 2afa019c70
build, meson: Fix rc files build order dependency...
by adding special filler custom_target() build rules.

Basically, these build rules do nothing (a mere meson --version call),
but they ensure that `git-version.h` is built first, before the dependant
rc files are used in respective resource compiler build targets.

This still a nasty trick (not a proper solution), but it do the job.

See #6257 for additional information.
2021-09-30 01:08:33 +06:00
Stanislav Grinkov dd02503cf8
gitlab-ci: Remove extra ninja call in crossroads Win builds
This workaround was placed to mitigate race condition.
It was useful for the time being, but not anymore.
Better solution will be introduced in following commit.

Reverting changes introduced in 9c6776fb.
2021-09-30 01:07:31 +06:00
Stanislav Grinkov 48ee6a1a72
build: meson.build minor code refactoring 2021-09-30 01:04:59 +06:00
Daniel Novomesky e43743e0eb Build libjxl in Win64 native MSYS2 CI 2021-09-29 18:43:08 +02:00
Daniel Novomesky 0236308d69 Build libjxl in crossroad Win64 CI 2021-09-29 09:43:39 +02:00
Anders Jonsson bb2174d59f Update Swedish translation 2021-09-28 20:31:18 +00:00
Yuri Chornoivan fe94b4674d Update Ukrainian translation 2021-09-28 20:02:36 +00:00
Yuri Chornoivan 0d2f3bc415 Update Ukrainian translation 2021-09-28 19:53:54 +00:00
Stanislav Grinkov f4ab5cd8e0
i18n: Add plug-ins/common/file-jpegxl.c in POTFILES.in
This source has translated text, hence should be included in
files checked for translations.

Resolves: #7298
2021-09-28 22:41:19 +06:00
Jordi Mas 6aaa017d34 Remove unnecessary space at the end of the string 2021-09-28 10:42:58 +00:00
Jehan fe551d6a57 NEWS: update. 2021-09-28 12:19:34 +02:00
Jehan e213f1f4ef plug-ins: minor styling fixes and other.
- .gitignore and gimprc.common updated by manually running ./mkgen.pl.
- Coding style fixes in file-jpegxl:
  * function names go to the line by themselves (return type on previous
    line).
  * avoid some overlong lines by breaking lines between parameters.
  * fix some alignments.
2021-09-28 11:40:33 +02:00
Daniel Novomesky 878c3f6ce6 Use more specific magic string for JPEG XL container format 2021-09-28 07:25:41 +00:00
Jehan 1b2ed2efd2 build: sync our nightly flatpak with last changes.
This is based from changes in wip/release/2-99-8 branch or the Flathub
flatpak (so not necessarily released yet):

- libheif bumped to 1.12.0
- Cairo with new patch to fix #235.
2021-09-27 12:43:36 +02:00
Daniel Novomesky 7ce0f2d60e Add JPEG XL plug-in 2021-09-27 09:22:24 +02:00
Jehan d4733e5b21 app: fix drag'n drop of fg/bg colors under Wayland.
Commit 086ae77929 had broken dnd of colors from toolbox's color area on
Wayland. Clearly Wayland did not like we changed focus on a click,
breaking the drag.

To fix this, do not propagate button press and release events from the
GimpFgBgEditor editor anymore. Yet, since changing colors is usually to
be used (often immediately) on the canvas, giving back the focus to
canvas still makes sense. Therefore, instead of using press/release
events, add semantic signals to GimpFgBgEditor: color-dropped,
colors-swapped and colors-default (additionally to already existing
color-clicked). Then connect to these new signals to grab focus for
canvas when relevant.

Thanks to Massimo for raising the broken color dnd feature.
2021-09-26 19:06:26 +02:00
Jehan 78d9f9799f app: fix dragging color boxes into item dockables.
Commit 83b3d9e5 broke dragging color widgets into channels dockables or
other item dockables.
Thanks to Massimo for raising that these lines were needed for this.
2021-09-26 17:06:57 +02:00
Jehan 6374481f4f Issue #6909: Crash after cancelling out of avif export dialog.
Do not leave dangling signal handler.
2021-09-26 16:30:29 +02:00
Jacob Boerema a4cb134f14 plug-ins: fix saving of XMP BAG/SEQ array values in metadata-editor
XMP array tags of type BAG and SEQ can have multiple values, each of
which is on a separate line. However, we were reading and saving it as
just one value.

We change this by setting each line as a separate value with
gexiv2_metadata_set_tag_multiple.

In addition to that we found that setting the type of tag struct with
gexiv2_metadata_set_xmp_tag_struct caused arrays of multiple values per
tag to be set incorrectly: the last value in the list got added multiple
times. I'm not sure if we are using this function incorrectly, or that
there is a bug in gexiv2 or exiv2. Anyway, since it seems that all tags
and values I tested work without calling this function, let's just omit
this call.
2021-09-25 14:54:45 -04:00
Jacob Boerema 76dc649b3f plug-ins: improve loading of XMP BAG/SEQ tags in metadata-editor
XMP array tags of type BAG and SEQ can have multiple values, each of these
values needs to be on a separate line to be correctly recognized as a
different value in the tag array. We were incorrectly loading all values
on one line separated by a comma.
For those tags that have equivalent IPTC tags we were also comparing just
the one XMP value with the whole, possibly multiple lines, of the same
IPTC, which could cause a failure to recognize identical tags.

We changed this to now have each value in a tag array on a separate line
by adding \n between values.
Each IPTC equivalent tag value is now compared to each value in the XMP
tag array and only added when a different value is found.
2021-09-25 14:39:40 -04:00
Jacob Boerema baaa1380cf plug-ins: in metadata-viewer improve how we show XMP tags.
XMP tags that have multiple values (usually of type XMpBag or XmpSeq) were
shown on one line. Which, especially for long text values, could make it
difficult to see the separate values for that tag.

Let's do the same as we do for IPTC tags that can occur multiple times and
show each value on a separate line.
2021-09-24 15:22:49 -04:00
Jacob Boerema e9ab89fa4f plug-ins: use separate function for adding multiple values per tag
In the metadata-viewer refactor the code that adds multiple values per tag
to the list store into a separate function.
Currently used for IPTC tags only but the intention is to reuse it for
XMP tags with multiple values.
2021-09-24 15:14:48 -04:00
Jacob Boerema e7f65e4b9f plug-ins: improve formatting in metadata-viewer 2021-09-24 15:11:03 -04:00
Jacob Boerema af888e481f plug-ins: fix #6258 Hierarchical XMP tag should be written to Array
When saving XMP metadata were using gexiv2_metadata_get_tag_string for all
tags, even those that can have multiple values. This caused those values
to be saved as one value instead of multiple.

To fix this we use gexiv2_metadata_get_tag_multiple, except for XmpText.
Then we add all returned values for that tag separately to our metadata.
2021-09-24 13:42:45 -04:00
Rodrigo Lledó 475e037eaf Update Spanish translation 2021-09-21 07:35:46 +00:00
Matej Urbančič f90e294a19 Update Slovenian translation 2021-09-19 18:31:50 +00:00
dimspingos 148fbb2244 Updated Greek translation 2021-09-15 11:10:17 +03:00
Anders Jonsson 88091607e6 Update Swedish translation 2021-09-14 20:45:17 +00:00
Jehan 6fd274794b NEWS: update. 2021-09-14 22:17:57 +02:00
Yuri Chornoivan 3b535b8702 Update Ukrainian translation 2021-09-14 17:45:24 +00:00
Jehan 1abb4543cd app, pdb: move "src-drawables" from core to option object for…
… "gimp-clone" and "gimp-heal" PDB calls.

Untested but this should work. Anyway we will take a close look at the
whole API before releasing.
2021-09-14 17:59:47 +02:00
Jehan 6ad00cdbba app: improve source tool options GUI.
The "Source" dropdown to choose an image or pattern, and to check
"Sample merged" seem important enough that I moved them up the source
tool options. I also added a label giving information about the image
source being currently set, i.e. in particular which image (when the
source is another image), how many composited layers (or all of them
with "Sample merged" checked), or if each layer is its own source.

For this to happen, I moved src-drawables property from GimpSourceCore
to GimpSourceOptions (though without making it a config property,
because we don't want this option to be saved in config files). It
actually makes sense, it is a kind of "option" of how the tool will
behave, and then it is also visible by the options GUI.
2021-09-14 17:59:47 +02:00
Jehan 370db868a3 app: "Registered" alignment makes no sense with self-to-self painting.
The "Registered" alignment is used to paint from one layer to another
(in same or different image) at exactly the same image coordinates. It
doesn't make much sense with the self-to-self painting when having
multiple drawables selected.

Note that it still works with the other new feature using multiple
layers as a composited source (limited "Sample merged"-like painting,
but only from specific layers).
2021-09-14 17:59:47 +02:00
Jehan b86c927210 app: fixing painting with a selection. 2021-09-14 17:59:47 +02:00
Jehan d5670644b4 app: make painting with applicator working in multi-drawable mode. 2021-09-14 17:59:47 +02:00
Jehan 03edaf5cea app: fix more broken offset in other tools.
Similar to the source core fix, but a bit simpler because we don't have
to deal with a source and a target offset, let's fix offset handling in:
- Blur / Sharpen tool.
- Dodge / Burn tool.
- Ink tool.
- MyPaint brush tool.
- Smudge tool.
2021-09-14 17:59:47 +02:00
Jehan 977807985b app: fix broken source painting offset.
As expected from early changes of code, painting was widely broken with
offsetted layers, because previous code used to process the drawable
offset earlier in the painting process, on paint tool level, whereas now
the tool gives coordinates in image space to the paint core (because it
gives a list of drawables which may have different offsets, hence image
space is the only valid coordinates space). This means the various paint
core algorithms must handle each drawable's offset at actual painting
time.
2021-09-14 17:59:47 +02:00