Commit graph

44826 commits

Author SHA1 Message Date
Jacob Boerema
b44e7daf4c plug-ins: fix #7524 DICOM File is broken
This is the same issue as with IM000001.dcm mentioned in issue #313.

There are two problems: incorrect endian conversion for 16 bits per pixel,
and not handling photometric interpretation "MONOCHROME1", which means
minimum value is white instead of black.

The endian conversion was fixed as suggested in issue #313.
For "MONOCHROME1" we added a variable bw_inverted and we invert the pixel
value if that variable is true.

(cherry picked from commit e51ca66ee5)
2022-01-18 16:32:15 -05:00
Jacob Boerema
1df5f20d65 plug-ins: fix #1111 TGA with indexed colors + alpha channel : not displayed correctly
Just like COLOR targa MAPPED (indexed) images with a size of 32 per
index should also have alphaBits set to 8 or else the images get
loaded incorrectly.

(cherry picked from commit a77131db3c)
2022-01-18 15:05:39 -05:00
Jacob Boerema
618280b07b plug-ins: fix #6871 indexed tga file cannot be saved
Exporting an image to TGA fails with a crash when it's an indexed image
with alpha channel. We were not taking into account that even though
the output is 1 byte per pixel, the input should allocate memory for
2 bytes per pixel (1 color index and 1 alpha channel).

(cherry picked from commit 059599fc78)
2022-01-18 15:03:52 -05:00
Rodrigo Lledó
f72ecd07b5 Update Spanish translation 2022-01-16 22:29:07 +00:00
Marco Ciampa
9f65f90ffb Updated Italian translation 2022-01-11 09:02:39 +01:00
Jacob Boerema
f061be280c 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.

(cherry picked from commit b2c715b52b)
2022-01-03 12:04:37 -05:00
Boyuan Yang
32b7756fa1 Update Chinese (China) translation 2021-12-26 19:03:17 +00:00
Piotr Drąg
d5e68e7359 Update Polish translation 2021-12-26 12:11:28 +01:00
Rodrigo Lledó
6fab87be3b Update Spanish translation 2021-12-22 21:53:05 +00:00
Matej Urbančič
4628e26d99 Update Slovenian translation 2021-12-21 07:14:20 +00:00
Hugo Carvalho
1d4f361e88 Update Portuguese translation 2021-12-20 15:49:50 +00:00
Anders Jonsson
05227c6889 Update Swedish translation 2021-12-20 00:04:03 +00:00
Jehan
571791f53f configure: post-release version bump to 2.10.31. 2021-12-19 22:51:39 +01:00
Yuri Chornoivan
9f24ea57f7 Update Ukrainian translation 2021-12-19 21:11:21 +00:00
U-YGGDRASIL\ender
cee406b593 Windows installer: add Portuguese language to .iss file, too 2021-12-19 21:20:19 +01:00
U-YGGDRASIL\ender
df64ff563f Windows installer: add pt translation 2021-12-19 21:04:23 +01:00
Jehan
150461732f configure: release GIMP 2.10.30. 2021-12-19 20:35:44 +01:00
Jehan
b270728177 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.
2021-12-19 20:11:16 +01:00
Jehan
8582bde9bb NEWS: update. 2021-12-19 19:08:46 +01:00
U-YGGDRASIL\ender
f8cdec1883 Windows installer: drop codepage conversion, use UTF-8 for language files 2021-12-19 18:59:02 +01:00
Jehan
ae542e29ee libgimpwidgets: small details to better sync with master branch.
The gimp-2-10 patch contributed as !514 was slightly different from the
master one as !515, especially since the last one got the reviews. This
syncs the 2 codebases (making it easier to backport future patches on
the same piece of code) and do a few fixes.

- Syncing alignments.
- Fix a comment.
- Use g_build_filename() for properly creating paths rather than string
  concatenations.
2021-12-19 16:02:50 +01:00
Yoshinori Yamakawa
ccb94344fc libgimpwidgets: Migration from GetICMProfile() to WcsGetDefaultColorProfile() 2021-12-19 14:56:10 +00:00
Øyvind Kolås
acf5ac8c7e configure, app: depend on GEGL-0.4.34 2021-12-19 00:56:30 +01:00
Jehan
4201cf60b1 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.

Note: this is the gimp-2-10 version of commit e8a31ba4f2 (`master`
branch) adapted to the older 2.10 API.
2021-12-18 23:58:53 +01:00
Jehan
2b82362eae 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.

(cherry picked from commit d5164072e0)
2021-12-18 23:39:53 +01:00
Jehan
1ba2e11c91 plug-ins: move KDE portal for screenshot as fallback to the X…
… implementation and Freedesktop portal.

This is an alternative to commit ef9c483771 (`master` branch) for the
2.10 series. On the dev branch, we simply get rid of the KDE portal
implementation, on the basis that by the time that GIMP 3 gets released,
most KDE users will have a recent-enough KDE with featureful Freedesktop
portal.

Yet for the 2.10 series, I am wary that there might still be many KDE
installations where maybe there is not even a Freedesktop portal. So I
just switch the test order. Now we use the X implementation in priority,
if we are running in X (it's still the most featureful and robust
version anyway). Then we test the Freedesktop portal. And finally we
test the KDE portal. I am guessing that if we encounter a KDE
installation with no Freedesktop portal but a KDE one, it's an old
version so we won't have permission issues.

See issue #5785.
2021-12-17 20:24:23 +01:00
Jacob Boerema
672931b39d plug-ins: fix previous commit, bumpmap should be bumpmap_id 2021-12-17 12:49:21 -05:00
Jacob Boerema
468c067d65 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.

(cherry picked from commit 7b7d616358)

# Conflicts:
#	plug-ins/lighting/lighting-image.c
2021-12-17 12:12:30 -05:00
Niels De Graef
dc8023b952 Fix compiler errors for XDG pickbutton impl
I forgot that we were on GTK 2 here :D
2021-12-15 08:57:56 +01:00
Niels De Graef
dcf0f9e7f4 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

(cherry picked from commit e82f6d5b0f)
2021-12-15 08:34:08 +01:00
Jehan
566be5e986 app: do not use PATH_MAX and realpath() on macOS.
See the comments in MR!424.
Basically realpath relies on false assumptions (probably ones which used
to be true when the API got created) on the max size of a path. Actually
nowadays paths can be much bigger than what the macro advertizes or can
even be unbounded.
The Linux version of realpath() allows the second parameter to be NULL,
in which case it would allocate the buffer, exactly for this reason
(written in the BUGS section on the man). Unfortunately this behavior is
not standardized in POSIX and the man from Apple I found does not
indicate it will do this.

So let's use g_canonicalize_filename() instead, which seems to do the
right thing. Similarly use g_strdup_printf instead of g_snprintf().

Cherry-picked from commit 6f4fac7715eb66a90727f931246c93cd8e13a819 with
some conflict resolution.
2021-12-14 23:14:04 +01:00
Niels De Graef
c375b2349a 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

(cherry picked from commit 62953e6830)
2021-12-14 16:14:30 +01:00
Aurimas Černius
56673462c9 Update Lithuanian translation 2021-12-13 14:35:32 +00:00
Aurimas Černius
8c9f70f202 Update Lithuanian translation 2021-12-13 14:32:48 +00:00
Anders Jonsson
983b9f277e Update Swedish translation 2021-12-04 14:29:19 +00:00
Jacob Boerema
48fa390e3f plug-ins: Fix previous cherry picked commit.
In 2.10 we need to use id's.
2021-12-01 21:56:15 -05:00
Jacob Boerema
778f811e8a 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.

(cherry picked from commit dec5ca2219)

# Conflicts:
#	plug-ins/file-dds/ddsread.c
2021-12-01 15:21:18 -05:00
Jordi Mas
c2d94121ca Update Catalan translation 2021-11-30 12:53:05 +01:00
Jehan
cc2660070c devel-docs: bump official macOS support to 10.12 on stable 2.10…
… series as well (it was already so in the `master` branch).

See discussion:
https://gitlab.gnome.org/GNOME/gimp/-/issues/7515#note_1318891

Basically it's probably possible to backport some changes and still
support an older version, but we clearly lack contributors on macOS so
the current unique one's decision matters most.
2021-11-26 23:43:06 +01:00
Daniel Mustieles
0a0cb402f2 Update Spanish translation 2021-11-23 16:55:53 +00:00
Matej Urbančič
6b825b1b0c Update Slovenian translation 2021-11-22 16:05:00 +00:00
Matej Urbančič
397e1ce2d8 Update Slovenian translation 2021-11-22 16:00:22 +00:00
Jacob Boerema
57f20f6fac plug-ins: fix #7109 exported gimp .jpg not processable in Windows Photo Viewer
In cases where the whole EXIF MakerNote is invalid we still load that
MakerNote data and export it too, causing partial invalid EXIF metadata.
We don't need to explicitly save Exif.Photo.MakerNote at all, because
as soon as we try to save a brand specific tag exiv2 will create that
MakerNote tag itself.
So from now we don't save the MakerNote but only the tags that go in it.
In issues like #2159 where exiv2 doesn't parse all tags inside certain
brand specific MakerNotes correctly, we will still export invalid EXIF.
That is an exiv2 issue that we can't do much about unless we remove all
MakerNote metadata including those that we can read, which doesn't seem
like a good idea at all.

(cherry picked from commit 6840bb9eba)
2021-11-21 18:42:06 -05:00
Jacob Boerema
b2396ec9d8 app: fix #383 Large PBM files exported from GIMP are blank
Fix as suggested by Massimo with formatting adjustments by me.
The use of gulong and glong is not cross platform safe: on Windows it is
32-bit and on most other platforms 64-bit.

Let's use guint64 and gint64 instead.

(cherry picked from commit d2c5591088)
2021-11-14 18:27:39 -05:00
Jordi Mas
d71aec77be Update Catalan translation 2021-11-14 14:44:53 +01:00
Piotr Drąg
dbd07a4f3f Update Polish translation 2021-11-14 14:28:21 +01:00
Hugo Carvalho
12877380b3 Update Portuguese translation 2021-11-13 17:40:19 +00:00
Milo Ivir
13f16221be Update Croatian translation 2021-11-12 14:12:32 +00:00
Milo Ivir
adb1330176 Update Croatian translation 2021-11-12 14:09:51 +00:00
Yuri Chornoivan
84000a25a2 Update Ukrainian translation 2021-11-09 14:17:26 +00:00