Commit Graph

47760 Commits

Author SHA1 Message Date
Jehan 201cbe7e3e build: no need to chmod the test file which is already executable.
Also when working on out-of-tree builds, it would not find the file
anyway and we get this output:

> chmod: cannot access 'test-installer-langs.sh': No such file or directory

Though this was not breaking the tests, it has clearly been useless
until we see this one today.
2021-12-22 17:13:07 +01:00
Jehan bf9c488560 build: fix Windows installer lang test after recent re-encoding drop. 2021-12-22 16:30:04 +01:00
Lukas Oberhuber 41ff82acbf macos: style cleanup in gimp wrapper code 2021-12-22 12:59:06 +00:00
Lukas Oberhuber e41250394d gimptextstyleeditor: Fix crash on exit
Messages were being sent to editor after editor had been destroyed. This
stops that.
2021-12-22 12:58:32 +00:00
Lukas Oberhuber d8afa6c829 gimp: macOS run from build directory
This change allows gimp to run from the build
directory rather than having to wait for the
full packaging process to complete.

However, 'gi' modules are not loading properly
so that might be something to fix.
2021-12-22 01:34:58 +00:00
Yuri Chornoivan d0dcb19e75 Update Ukrainian translation 2021-12-21 21:14:29 +00:00
Hugo Carvalho 25a5d06589 Update Portuguese translation 2021-12-21 15:50:30 +00:00
Jehan 6cf3d67e64 build: fix packaging step with MSYS2 GTK+3. 2021-12-21 00:41:39 +01:00
Anders Jonsson e87b3d5816 Update Swedish translation 2021-12-20 20:40:18 +00:00
Jehan c59c93cd19 build: do not build GTK3 for our MSYS2 dependency job anymore.
The patch we needed to test needs completion, so it's of no use to
continue building it until this happens.

Also for some reason, the x86_64 build of GTK3 takes forever and times
out (the same build for 32-bit x86 is done quickly as expected) on
repeated occasions. Since this is unneeded right now, rather than
wasting time on this, I just delete this dep build to use the pre-built
MSYS2 package.
2021-12-20 21:25:42 +01:00
Jehan 3e1b783adb build: drop codepage conversion, use UTF-8 for Win install lang files.
Rewriting commit f8cdec1883 by Jernej Simončič for the development
code (which has a slightly different list of languages).

Also adding the meson version of this change.

Since now InnoSetup fully supports UTF-8 isl (as long as they have a
BOM), let's stop converting translations. Then we also avoid all
conversion errors and get a simpler/more robust build process.
2021-12-20 18:50:50 +01:00
Jehan 321cdd9d04 desktop: AppData tag for GIMP 2.10.30.
Sorry to translators! I guess this one won't be localized then, but it's
ok. This release was a bit unplanned.

(cherry picked from commit b270728177)
2021-12-20 13:51:59 +01:00
Øyvind Kolås 124239202c app,build: depend on GEGL-0.4.34 2021-12-19 00:59:33 +01:00
Lukas Oberhuber e5157f9894 configure.ac: Correct detection of `xgettext`
On macOS at least, `xgettext` is not being correctly identified because
`AM_GLIB_GNU_GETTEXT` is blowing away `XGETTEXT` variable which then
messes up the version checking.

This moves that macro to after the version check.
2021-12-18 00:15:49 +00:00
Yoshinori Yamakawa 2d1c447508 libgimpwidgets: Migration from GetICMProfile() to WcsGetDefaultColorProfile() 2021-12-17 21:58:03 +00:00
Jehan ef9c483771 plug-ins: remove KDE screenshot portal in favor of Freedesktop portal.
On recent KDE, the screenshot plug-in fails with an authorization error,
unless we add a desktop file with a special KDE-only desktop entry to
give the permission, which seems a bit over-the-top (if we were to add a
desktop file for every plug-in, and with dedicated entries to every
desktop environment out there, it's never-ending). Of course, we are not
against either, but nobody has contributed a patch doing this in the
last year anyway.

Also Méven (KDE dev) was telling us that KDE recommends to use the
Freedesktop portal nowadays. So maybe let's just move on from the
KDE-specific portal, just as we did recently for the GNOME portal too.
This should hopefully take care of all permission issues and in the same
time simplifies the code.

Note that the Freedesktop API might miss some of the features (this was
one of the reason we were avoiding putting it as priority implementation
until now, to avoid feature regression), but the more we go, the less we
have a choice. It's either this or always fighting against the current.
2021-12-17 20:14:18 +01:00
Jacob Boerema 7b7d616358 plug-ins: fix #5305 Lighting Effects crashes when I use a channel as Bumpmap
When a channel is selected as bumpmap, the bump_format can be different
than it was before. However, we always kept the first bump_format, which
could be RGB, in which case trying to use it with a channel caused a
crash in GIMP.

To fix this we always update the bump_format if bumpmap is enabled.
2021-12-17 12:06:18 -05:00
Jehan e8a31ba4f2 plug-ins: in file-gegl, use the accurate load/save GEGL operation…
… rather than generic "gegl:load" and "gegl:save".

In particular, it means using "gegl:rgbe-load|save" for RGBE images and
"gegl:exr-save" for EXR exporting.

Without this, we could encounter weird run cases where for instance, we
would detect a RGBE image through the file magic number in GIMP,
redirect the load to file-gegl, but "gegl:load" only relies on file
extension. So if the file extension was not ".hdr", "gegl:load" could
redirect to a different handler operation meant for another format,
hence break proper loading. If no extension was matched, it could even
redirect to a fallback handler, such as Image Magick.

This breaks loading or saving images which we would be otherwise able to
load/save. And it could also have some security implications. So let's
fix this by setting the accurate operations to use for each specific
file formats we want to support through the file-gegl plug-in.
2021-12-17 17:19:34 +01:00
Jehan d5164072e0 plug-ins: fix Radiance RGBE magic number.
Note that the full magic should be "#?RADIANCE". Not sure why we only
use the first 2 characters. Do some software create these RGBE files
with just "#?" and we want to be able to read these? No other image
format use these 2 characters as the start of their own magic numbers?

Anyway let's keep like this for now. We'll see. If it makes a problem,
we might update to more accurate magic later.
2021-12-17 17:02:36 +01:00
Jehan 24d6140782 build: make sure InnoSetup language files are not already present.
I noticed in our build logs such output:

> Saving to: ‘Basque.isl.53’

Wget does not override same-named files and would append a number. The
thing is that we are not supposed to have other .isl files over there,
but I think current Windows runners on Gitlab are not properly wiped
out. That must be why we get remnant of old files.
Anyway this will make sure we override, hence use the last version of
translations (otherwise we are stuck to old versions as long as they are
not wiped out, since the downloaded file is not properly named).
2021-12-17 17:02:12 +01:00
Niels De Graef bba495999d app: Use g_clear_object() in main.c
Also no need to do a null-check if you're doing g_free(), it can handle
that already.
2021-12-17 09:49:05 +01:00
Jacob Boerema b2c715b52b plug-ins: fix #7464 GIMP stops responding opening metadata on import
Some images have huge amounts of XMP tag Xmp.photoshop.DocumentAncestors.
In certain cases more than 100000 values. This is apparently due to a bug
in certain versions of PhotoShop.

This makes deserializing it in the way we currently do too slow, probably
because of continuous reallocations after adding each value. Until we can
change this let's remove everything but the first 1000 values when
serializing. I think it is very unlikely there are any real cases where
more than a 1000 ancestor documents are referenced in an image. Testing
shows that this amount doesn't cause any serious slowdowns.
2021-12-15 12:01:39 -05:00
Niels De Graef e82f6d5b0f libgimpwidgets: Use Screenshot portal for picking
Freedesktop (XDG) portals are a collection of D-Bus APIs that work
across desktop environments, display servers and work within
containerized applications, like Flatpak. The internal implementation
can then choose to implement these in such a way that takes into account
security considerations, as well as making sure the user consents to
certain actions.

One such portal is the `Screenshot` portal, which contains a
`Screenshot()` method as well as `PickColor()`. We already use the
former for taking a screenshot, and this commit makes sure our color
picker also makes use of the latter.

By doing this, color picking is now possible on the major Wayland
compositors.

(Honestly, we should remove DE-specific backends like that of KWin, to
have less variation on the possible results of a color picking
operation).

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/1074
2021-12-14 23:15:49 +01:00
Jacob Boerema e51d5d480d plug-ins: add extra layer groups when loading PSD images with clipping layers
Together with the previous commit this mostly fixes #5438.

PhotoShop handles clipping layers in a different way than GIMP. The only
way to have it look the same is by adding extra layer groups.
PSD layers that have clipping set, combined with the first non clipping
layer below it are grouped together in a new layer group.
Doing this results in the same image as the PSD merged image unless there
are other PSD elements in play that we don't handle yet.

See e.g. the NSFW image in the mentioned issue where the purple hair color
is a little darker than the merged image.
2021-12-14 12:27:16 -05:00
Jacob Boerema e7f85f7b3f plug-ins: PSD layers with clipping set need clip to backdrop as composite mode
Certain PSD layers have a flag called clipping set to 1. We were not
handling this flag and had some reports about colors bleeding where
they were not supposed to.
We are going to set GIMP's layer composite_mode to
GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP, which is the closest we can get
to PhotoShop's clipping. With this, the colors won't bleed anymore.
This isn't the whole solution since PS apparently stops compositing when
it encounters a layer without clipping set, while GIMP doesn't stop until
it reaches the bottom layer of a group or the image.

This is the first part of a fix for issue #5438.
2021-12-14 12:27:16 -05:00
Jehan c502fb18ce plug-ins: show screenshot options dialog immediately in Freedesktop…
… portal.

Otherwise, it first takes a screenshot and proposes to either share or
tweak the "Options" (in the GNOME shell implementation at least). Doing
the other way around is much more in line with how we had done it until
now with our custom dialogs.
2021-12-14 17:59:25 +01:00
Niels De Graef 62953e6830 screenshot: Remove GNOME Shell implementation
GNOME Shell has started restricting access for it's Screenshot D-Bus API
to internal components only [1] for security reasons. In other words,
this will start failing, so remove it in favor of just using the
freedesktop portal, which should always work.

[1]: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970
2021-12-14 11:36:40 +00:00
Niels De Graef bb4403fd49 app: Remove old GimpUiManager popup API
The code used `gtk_menu_popup()`, which was deprecated a while ago, as
it was broken on certain GDK backends, like Wayland.

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/5319
2021-12-13 20:57:23 +01:00
Niels De Graef eed28c0941 app: Popup menu at rect in GimpEditor
Rather than trying to fix up our own heuristics using a
`GtkMenuPositionFunc`, use whatever GTK provides to position given a
specific rectangle, which also has the benefit of nicely integrating
with GDK backends such as Wayland. Another advantage is that we can use
GdkGravity to center the popup.

Since GTK 3, GtkWidget also gained a "popup-menu" signal, which we
can/should use instead of rolling our own context signals.
2021-12-13 20:57:21 +01:00
Niels De Graef 67fd1f0c52 app: Popup menu at pointer in GimpEditor
Rather than trying to fix up our own heuristics using a
`GtkMenuPositionFunc`, use the API that GTK provides to have popup
nicely placed near the pointer, which also has the benefit of nicely
integrating with GDK backends such as Wayland.
2021-12-13 20:56:54 +01:00
Aurimas Černius cf55b61358 Update Lithuanian translation 2021-12-13 14:56:21 +00:00
Niels De Graef b2f875e889 modules: Use GtkGestureDrag in ColorWheel
This allows us to simplify some of the logic, and get rid of a
`gdk_seat_grab()` which might trigger unwanted popups. It's also a bit
more future-proof, as it uses the same mechanism to what is used in
GTK4 for event handling.

While we're at it, stop storing a separate `priv` pointer, which would
allow us to use `G_DECLARE_FINAL_TYPE()` in the future.
2021-12-12 22:28:46 +01:00
Niels De Graef 06de8abd6e libgimpwidgets: use GtkGestureDrag in ScrolledPreview
This allows us to simplify some of the dragging logic, and makes us a
tiny bit more future-proof for GTK4, which uses a similar construction
with `GtkEventController`s.

While we're at it, stop storing a separate `priv` pointer, which would
allow us to use `G_DECLARE_DERIVABLE_TYPE()` in the future.
2021-12-12 22:27:48 +01:00
Matej Urbančič e9ef4b797d Update Slovenian translation 2021-12-06 21:47:32 +00:00
Yacine Bouklif 70dc70d255 Update Kabyle translation 2021-12-05 20:44:10 +00:00
Yacine Bouklif 9dda014b57 Update Kabyle translation 2021-12-05 19:56:25 +00:00
Jehan 44f6ee36fe meson: missing test for sys/prctl.h.
This is needed for prctl(), to allow a child process to trace the
parent.
2021-12-04 18:50:34 +01:00
Anders Jonsson 156d00f7d3 Update Swedish translation 2021-12-04 14:32:46 +00:00
Lukas Oberhuber 6821636a7b gimp_macos_setenv: set GI_TYPELIB_PATH macos
This sets the GI_TYPELIB_PATH so that macOS
gobject-introspection can find the typelib files.
2021-12-03 10:14:35 +00:00
Niels De Graef 5ca9a38ea4 Fix some gobject-introspection annotations 2021-12-02 12:46:05 +01:00
Niels De Graef dcd1dd29a8 libgimpcolor: Fix gimp_rgb_list_names() for introspection
This functions has 2 `(out) (array)` arguments, where the array length
is defined by the return value. This can't be expressed in GIR
annotations unfortunately, so just add it as another `(out)` argument.

Also, by default `(out)` args are assumed to be `(transfer full)`, while
these were actually `(transfer container)`.
2021-12-02 12:43:57 +01:00
Lukas Oberhuber b0547a72c6 macos env: Fix #7567, crash on new and open dialog
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/7567
2021-12-01 23:12:44 +00:00
Jacob Boerema dec5ca2219 plug-ins: fix #7566 Import Issues with Indexed .dds Images
This proved to be both an import and export issue.
Our import set expected format as RGB, causing garbled image output.
Our export for indexed images converted to grayscale first, although the
palette was correctly saved. This caused wrong palette indexes on import.

For indexed images, on import, we request the actual indexed format after
creating the layer with gimp_drawable_get_format, which gives us a correct
indexed Babl format.
Also added logic for indexed with alpha, although I have no sample images
to test this.
For indexed images on export we do the same: use gimp_drawable_get_format
to get an actual indexed Babl format.
2021-12-01 15:01:48 -05:00
Jehan 9b94e347bc Issue #7539: Opening some images lock GIMP.
In some conditions, and only with some installations, the called GDB
ends up hanging and never returning. Worse, even if you use non-blocking
functions such as poll() or select() with a timeout, in order to wait
for the debugger output, these block anyway and never return.

We are currently unsure what exactly causes such problem, but not using
the thread command in gdb avoids it for now.

This is a bit of a regression, though most of the time anyway the useful
traces are the main thread ones (I think ever since I implemented this,
there must not have been more than 2 or 3 cases where we actually needed
the secondary traces). So it's acceptable, at least for now.
2021-12-01 18:37:18 +01:00
Lukas Oberhuber ee30d50d60 packaging: Update paths for MacOS
Updates the various path variables used to run the applicaition on Mac.
This includes update to python.
2021-11-30 17:09:00 +00:00
Jehan e69b7049d3 NEWS: update. 2021-11-30 17:58:28 +01:00
Jehan 8e5edac390 Coding Style: add necessity to keep POTFILES.in updated. 2021-11-30 17:42:17 +01:00
Jehan 52f2ea5b34 Coding Style: add some docs about natural language text in GIMP.
This includes info on how to use gettext API, but also on using
gender-neutral forms (cf. a recent commit) or other base rules for
decision making.
2021-11-30 15:17:06 +01:00
Rodrigo Lledó d2be6080a5 Update Spanish translation 2021-11-30 12:50:40 +00:00
Jordi Mas de286a0448 Update Catalan translation 2021-11-30 12:53:50 +01:00