Commit graph

47398 commits

Author SHA1 Message Date
Hugo Carvalho
c2dfbb5c2f Update Portuguese translation 2021-10-06 21:20:06 +00:00
Hugo Carvalho
1114d955ac Update Portuguese translation 2021-10-06 21:08:40 +00:00
Daniel Novomesky
c4e5c185cc HEIF plug-in: fix typo in comment 2021-10-06 14:35:54 +02:00
Jehan
31e52f0756 build: allow giving several source prefixes to dll_link.py.
Also use it to fix packaging of GIMP for the Windows installer (native
CI job). The CI was indeed failing to package libbrotlienc.dll,
dependency of libjxl.dll, for the simple reason that they were on
different prefixes. By calling dll_link.py on one prefix, then the
other, we were failing to grab the deeper dependency. Now with this new
ability to set several sources, the script is able to search everywhere
(with first prefix given on the CLI call as priority).
2021-10-05 02:53:38 +02:00
Lukas Oberhuber
5ff5d38985 Macro name change to GDK_OSX_BIGSUR 2021-10-04 20:40:30 +00:00
Lukas Oberhuber
0ac0e4bdc9 gdkquartz-cocoa-access.h is not correct yet 2021-10-04 20:06:35 +00:00
Daniel Novomesky
dd5cb5cef1 Crash workaround for HEIF plug-in 2021-10-03 15:11:25 +00:00
Piotr Drąg
9c4c7b5d52 Update Polish translation 2021-10-03 13:29:09 +02:00
Lukas Oberhuber
e14f9fc500 app: allow compiling on Mac OS where gimpimagewindow.c needs…
… an API that went private in GTK 3.

Note from reviewer (Jehan): this API became public again in commit
gtk@242b76a7, available since GTK 3.24.29. Before this, the function 
(gdk_quartz_window_get_nswindow()) was actually still in the ABI, so we
could declare the function locally before using it. This is an ugly
workaround, but it works.
What we do is providing both solutions depending on GTK version, leaving
build warnings as constant reminders so that we remember to get rid of
the workaround when we bump minimum GTK requirement.

Cf. discussions in gtk#2452 and gimp!483.
2021-10-03 11:20:15 +00:00
Lukas Oberhuber
f87ec4bcfe libgimpbase: GError set twice in gimpreloc.c
This patch fixes a double free error due to a pointer being freed and 
then not nulled out.
It appears this is corrupting memory on MacOS as the `/proc` file system 
is not available and therefore multiple errors are returned.

Fixes:

(process:54873): GLib-WARNING **: 23:09:25.976: GError set over the top of
a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL
before it's set.
The overwriting error message was: Error opening file /proc/self/maps: No
such file or directory
_br_find_exe: (NULL)gimp-console(54873,0x100957e00) malloc: *** error for
object 0x103f09e80: pointer being freed was not allocated
gimp-console(54873,0x100957e00) malloc: *** set a breakpoint in
malloc_error_break to debug
2021-10-03 00:29:15 +00:00
Anders Jonsson
d33c45fb47 Update Swedish translation 2021-10-02 12:14:41 +00:00
Jordi Mas
1791c17946 Update Catalan translation 2021-10-01 23:27:05 +02:00
Jehan
6107ae17c9 build: build libjxl to sync nightly and beta flatpak manifest.
See commit e9f790e1ff8d50f63933ec0b0fbb9325447324d4 on Flathub's beta
flatpak repository.
2021-10-01 23:09:50 +02:00
Jehan
e61adec232 plug-ins: more g_file_get_path() changed to g_file_peek_path().
Also some g_unlink() changed into g_file_delete().

And a g_file_get_path() followed by g_path_get_basename() changed into
g_file_get_basename() only.
2021-10-01 22:59:53 +02:00
Jehan
60b9f4a2d5 NEWS: update. 2021-10-01 22:33:10 +02:00
Jehan
4055ac95e6 build: add more help text to the windows-installer-langs test.
I always have to search again the InnoSetup repository for the language
file. Add the link in the failed test output so that we don't waste time
searching the next time.

Also when the new lang is "Unofficial", the installer script has to be
updated as well, because these lang files must be downloaded. Add a help
text saying this as well.
2021-10-01 21:51:22 +02:00
Jehan
3ace66ecbb build: add Portuguese translation to installer.
Translation files were added in commit cec3c3a159 but not to the
installer and build files, which is why "gimp-distcheck-debian" job was
failing in the CI.
2021-10-01 21:18:43 +02:00
Jehan
9cd9c34251 build: improve gimp:build / windows-installer-langs unit test.
Also sort the po files to make sure all lists are ordered the same way.
2021-10-01 21:17:24 +02:00
Jehan
f131780777 plug-ins: clean up warnings from psd-save.
These warnings only happens on debug output, so it's not huge bugs, yet
it's always better not to have warnings at build time.

Most are printf format type warnings, and one is because of uncomplete
switch() cases.
2021-10-01 19:43:49 +02:00
Jehan
4ae3687c88 plug-ins: more replacement of g_file_get_path() to g_file_peek_path().
While doing this cleanup, I found at least several other string leaks
in: file-compressor, file-gegl, file-pdf-save, file-raw-data, file-xwd,
jpeg-load, psd-save…
So it's quite worth it!

Note: in file-pdf-save, there is a global variable file_name which seems
to be happily leaked without caring (didn't look in details, but looks
so). I didn't fix this one which will require a bit more in-depth logics
care.
2021-10-01 19:37:59 +02:00
Jehan
27dea4f7f7 plug-ins: various g_file_get_path() replaced by g_file_peek_path().
As explained in previous commits, the _peek_ call is advantageous
because:
- It is less bug-prone as we don't have to handle freeing the string. In
  all the cases I changed, I even spotted at least 2 cases where we were
  leaking a string (in file-mng, `temp_file_name` is never freed; and we
  were also leaking in an error case of gfig).
- As a consequence of the previous point: simpler code with less lines.
- In local file cases, the _peek_ variant does not even need to allocate
  an additional string.
- In other case, if we query several times the path, it is allocated
  once and cached so it stays efficient.
- When possible, working on the GFile rather than on a path string may
  be more robust. For instance I changed one g_unlink() into a
  g_file_delete(). Actually most reading/writing should be done with the
  GIO API when possible, but I didn't want to change too much code
  logics on this commit.
2021-10-01 18:47:30 +02:00
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