Commit Graph

49438 Commits

Author SHA1 Message Date
Jehan ee92210dde app: fix an unused variable warning. 2023-02-22 12:46:56 +01:00
Jehan 36cc6c6e8a configure, libgimp: disable introspection when building libgimp with sanitizer.
The initial issue was that 3 leaks were detected when running the "DumpCompiler"
during g-ir-scanner phase. The failing command was apparently about running some
temp binary, which looks like would be called the DumpCompiler in g-ir-scanner
code:

> libgimp/tmp-introspectn8jg64to/Gimp-3.0 --introspect-dump=libgimp/tmp-introspectn8jg64to/functions.txt,libgimp/tmp-introspectn8jg64to/dump.xml

My first fix attempt was to try and play with build/link FLAGS so that this temp
binary is built without sanitizer. But the problem when I did this was that
libgimp itself is sanitized, so we are mixing a sanitized lib with a
non-sanitized binary:

> ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

So it looks like I could still solve this with tweaking LD_PRELOAD, cf. this
sanitizer FAQ: https://github.com/google/sanitizers/wiki/AddressSanitizer#faq

Nevertheless it proved complex to do it right while not interfering with other
parts of the build and I found out that I risk encountering more issues down the
road with GIR + sanitizer:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/375

So I've decided that I didn't want to waste too much time on this and simply
disable introspection when sanitizing, as I guess what we care the most to
diagnose when sanitizing is core code anyway.
2023-02-22 12:23:26 +01:00
Jehan 0b75fbd91c tools: do not sanitize build tools. It's OK if they leak a bit.
Especially as our code does not actually leak as far as we can see. It looks
like librsvg might not play well with -fsanitize=address (possibly having real
leaks or false positives).
2023-02-22 10:57:36 +01:00
dimspingos e0f070a649 Update Greek translation 2023-02-22 10:01:06 +02:00
Alexander Shopov 2616df0921 Update Bulgarian translation 2023-02-21 10:27:03 +00:00
dimspingos 07516e2c4d Update Greek translation 2023-02-21 12:21:53 +02:00
dimspingos 0d14b0bca7 Update Greek translation 2023-02-20 13:06:35 +02:00
Jehan 577d803bd4 app: don't draw the drop zone, just nothing when converting.
(cherry picked from commit 6adf574513)
2023-02-19 18:54:46 +01:00
Jehan aab73ae3a4 app: fix a crash when converting to higher precision.
gimp_display_shell_render() writes to a GeglBuffer backed by allocated memory
(shell->profile_data). Unfortunately while converting prevision in
gimp_image_convert_precision(), we change the "precision" property (hence the
source format) first, hence end up trying to write data in a too small buffer.
This crash was hard to find as it was not showing up on my machine (though it
did produce rendering artifacts!), unless I built both GIMP and babl with
`b_sanitize=address`.

Note that an alternate fix was to make sure that the profile_data buffer is big
enough (by calling gimp_display_shell_profile_update() before rendering), but
anyway the image is in an inconsistent state while conversion is in progress:
whereas the `src_format` is the new one, the `src_profile` is still the old one
(and cannot be changed before we finish converting).

Moreover the render happen regularly on progress signals, once after each
converted drawable. So each of these rendering step happens in an inconsistent
state, with the wrong profile set, some of the drawables converted and others
not yet.
We could still render properly if each drawable's buffer used space-aware format
(thus allowing different drawables to use different profiles/spaces), but it
feels over-engineering the problem. It might be much better to ignore rendering
steps while converting the image precision. Moreover it would obviously make a
faster conversion.

See discussions in #9136 for this crash, which didn't have dedicated report
AFAIK.

(cherry picked from commit de25be9210)

Note: on the `master` branch, even with sanitized code, I don't get the crash.
Yet this change seems relevant enough that I'm adding it.
2023-02-19 18:46:31 +01:00
Jacob Boerema ba9ceae7d7 Revert "Upload New File"
This reverts commit 2023e4c6ca.
2023-02-18 18:40:42 -05:00
dimspingos 9f2942fec9 Updated Greek translation 2023-02-18 21:12:47 +02:00
Dimitris Spingos 2023e4c6ca Upload New File 2023-02-18 13:14:10 +00:00
Piotr Drąg 34f8a20e5f Update Polish translation 2023-02-18 11:50:27 +01:00
Alexander Shopov adde450fb7 Update Bulgarian translation 2023-02-18 07:47:21 +00:00
Martin 641679cd31 Update Slovenian translation 2023-02-17 20:13:50 +00:00
Ekaterine Papava 4acaca633a Update Georgian translation 2023-02-17 05:02:37 +00:00
Jehan d5f845e35a Issue #9147: freeze when switching from multi-window to single window mode.
Don't keep bindings to still existing objects. We were ending up in some ugly
infinite looping.

(cherry picked from commit bddcd5c268)
2023-02-16 22:26:17 +01:00
Jehan 18c21abf0c libgimp: fix a memory leak.
Discovered while playing with b_sanitize=address flag.
2023-02-16 20:59:33 +01:00
Jehan 7f29543895 app: fix global-buffer-overflow in "gimp:dissolve" implementation.
In case of negative y in the region to process, we were accessing invalid memory
(negative array index).

I hesitated between make so that a given ordinate always use the same index or
if we just want the start ordinate (whatever it is) to use index 0. The later
could have just been `(y - result->y) % RANDOM_TABLE_SIZE`.

I just decided to keep the existing logic (former case) though to be fair, not
sure it matters much.

(cherry picked from commit a86560bb57)
2023-02-16 20:31:41 +01:00
Jehan 31672ee340 tools: avoid build-only tool with memory issues. to break the whole build.
Cf. the previous commit: colorsvg2png has a memory leak in librsvg (so we can't
fix it easily). In any case, it's just a one-time-use tool, we don't really need
to focus on its memory bugs as long as it does its job to make icons.
2023-02-16 20:07:41 +01:00
Jehan 8e32da9889 tools: better memory handling in colorsvg2png.
Actually even with this, b_sanitize=address still detects a memory leak. After
some testing, it seems that just creating a RsvgHandle, then freeing it
immediately is enough to leak some data, which means the leak is in librsvg.
2023-02-16 20:07:41 +01:00
Hugo Carvalho 1d5a6a4829 Update Portuguese translation 2023-02-16 18:36:54 +00:00
Yuri Chornoivan 4a2a000924 Update Ukrainian translation 2023-02-16 14:06:56 +00:00
Alx Sa 5102355ac9 plug-ins: Port ImageMap to GAction/GMenuModel
Additionally, the ImageMap-specific icons weren't showing up due to the
filenames not matching the references strings ("imap-polygon" but
the filename was "imagemap-polygon.png"). This patch fixes that by
renaming the strings to match file name.
Partial code style fixes were made as well; a lot more are needed.
2023-02-16 04:16:11 +00:00
Martin 8b204d50ff Update Slovenian translation 2023-02-15 22:09:18 +00:00
Jehan 6a2908ed0b Issue #9151: link to the "Building GIMP" page of dev website in INSTALL. 2023-02-15 12:13:24 +01:00
Sabri Ünal e9270d3d1f Update Turkish translation 2023-02-14 21:25:50 +00:00
Sabri Ünal 2f9d431271 Update Turkish translation 2023-02-14 21:22:04 +00:00
Sabri Ünal 5306c475d3 Update Turkish translation 2023-02-14 21:19:40 +00:00
Jacob Boerema 5ef77e6e8e plug-ins: disable magics detection for Windows CUR and ICO files
The magics used for detection for CUR and ICO are not very unique and
interfere with the detection of certain types of TGA images.
Since these TGA images are regularly used, it seems better to only base
CUR and ICO detection on the extension, just as we do with TGA version 1
files.

See also issue #7912
2023-02-14 15:16:15 -05:00
Jacob Boerema 5f9415a641 plug-ins: fix #9067 TGA files saved by Krita can't be opened
Krita had a bug where it incorrectly saved 4 for the alpha bits instead of
8. We will allow 4 and convert that to 8 to be able to read the incorrect
TGA images.

The likelyhood of real TGA images with 4 alphabits seems pretty low, so it
should not interfere with real images that have this set. We were not
supporting that anyway.
2023-02-14 15:16:15 -05:00
Alan Mortensen 375e91cb9d Update Danish translation 2023-02-14 20:02:01 +00:00
Yuri Chornoivan 6a8db1dd21 Update Ukrainian translation 2023-02-14 18:08:34 +00:00
Hugo Carvalho 7321061588 Update Portuguese translation 2023-02-14 16:56:22 +00:00
Ekaterine Papava 7afb2b15e4 Update Georgian translation 2023-02-14 16:47:42 +00:00
Jehan 1b780cd8e0 app, libgimp, pdb: minor fixes.
- fix a typo s/Commponent/Component/.
- Add &std_pdb_compat() to the new PDB procedures (I realize that's probably
  what the contributor was asking about, back in !446). Not sure if it's right
  as there were none in this file, but these are clearly just wrappers around
  GEGL ops, so it seems fitting.
- Some alignment fixes.
- More accurate "$since" variables.

(cherry picked from commit 66ef1ef1ef)
2023-02-14 17:18:38 +01:00
Jehan c6972eabde pdb: meson-pdbgen.sh should return the return value of pdbgen.pl.
Otherwise even when the main script fails, hence generation of source files does
not end up correctly, the build continues (and likely fails later).
2023-02-14 15:36:19 +01:00
Ian Martins acdf5a3776 pdb: add a PDB procedure for extract-component
(cherry picked from commit dbf9f277a2)

Committer's (Jehan) updates:

- Component type is now int32 (int8 is not a PDB type available anymore).
- PDB files re-generated to handle changes in API and types.
2023-02-14 15:36:19 +01:00
Stanislav Grinkov d1eb30d863
themes: Set smaller Compact theme separator width...
for better consistency with the overall theme.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov bbbbc671eb
themes: Increase dockable panel separator width...
to make panel resizing action more accessible.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov 49cbe651a6
themes: Add three-dot handle to paned separators ...
to improve their accessibility to Default, Gray,
and Compact themes.

Resolves: #9144
2023-02-14 16:50:32 +06:00
Hugo Carvalho 25d6c51bf5 Update Portuguese translation 2023-02-14 10:49:38 +00:00
Martin e19143cffb Update Slovenian translation 2023-02-14 00:16:07 +00:00
Jehan 473f0b49ef app: better handle bogus file names.
When a plug-in enters a bogus file name such as "Untitled.xcd" as URI,
g_file_is_native() returns FALSE. So when saving such file, core code tries to
mount a remote volume and fails (of course), without even opening the file
dialog.

This change is an attempt to detect such cases beforehand and not even try to
save it (just open the file dialog directly; the file name is still useful as
default proposed file name, as this part is actually valid).
Actually remote files will have a valid URI anyway (something with a valid
scheme, such as https:// or whatever other scheme).

As side fix, I am adding a missing space to the error which I got.
2023-02-13 22:57:09 +01:00
Jehan 4f1d0fb53b plug-ins: get rid of various gimp_image_set_file() calls.
- This is unneeded in all import procedures. See previous commit. Note though
  that this is not because of a change in previous commit. This was already
  useless previously. The file set with this PDB function was overridden by the
  core anyway (i.e. even before the previous commits).
  In app/file/file-import.c:file_import_image(), the imported file is correctly
  set (so there is no need to set it from plug-in, which anyway libgimp's
  gimp_image_set_file() was not doing) and the XCF file is reset to NULL
  (rendering the call to gimp_image_set_file() in a GimpLoadProcedure useless).
- Similarly, this is a useless call in export procedures because
  app/file/file-save.c:file_save() overrides such call too. I could only see one
  such case for JPEG export, which was quite useless.
- Finally in other types of plug-ins, setting a non-XCF file extension was
  interfering with the save feature (similarly to commit e6e73e14c7). I only
  fixed the screenshot implementations doing such a thing.
- I left a few usages which will have to be looked at more in details later.
2023-02-13 22:54:16 +01:00
Jehan fc2925def0 app, libgimp, pdb: gimp_image_set_file() only works for XCF files.
This is not made to set the imported or exported file, but only the XCF file.
See previous commit to see what happens when this API is used to set non-XCF
file extensions (saving fails unless one edits the filename).
2023-02-13 22:54:01 +01:00
Jehan e6e73e14c7 Issue #8581: forward-porting file-name fix from `gimp-2-10` branch.
This is a port of commit 57ee6e13ab to the main dev branch.
2023-02-13 22:54:01 +01:00
Daniel Novomeský dc8121729d flatpak: upgrade libjxl, highway, libde265 2023-02-13 17:59:14 +00:00
Ekaterine Papava 3381ad0a7f Update Georgian translation 2023-02-13 17:22:57 +00:00
Yuri Chornoivan 4929b505f7 Update Ukrainian translation 2023-02-13 15:33:22 +00:00