From 31d023ce7194947e975dcde34ef243fcc35cbbbe Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Thu, 15 Aug 2024 10:09:14 +0200 Subject: [PATCH] Fix building TIFF loader on big endian [skip changelog] Signed-off-by: Nils Philippsen --- ...x-building-TIFF-loader-on-big-endian.patch | 45 +++++++++++++++++++ gimp.spec | 9 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 0001-plug-ins-Fix-building-TIFF-loader-on-big-endian.patch diff --git a/0001-plug-ins-Fix-building-TIFF-loader-on-big-endian.patch b/0001-plug-ins-Fix-building-TIFF-loader-on-big-endian.patch new file mode 100644 index 0000000..9ec6fb9 --- /dev/null +++ b/0001-plug-ins-Fix-building-TIFF-loader-on-big-endian.patch @@ -0,0 +1,45 @@ +From d101dc6b0a1acceb0286b8232a58ff7b6448502b Mon Sep 17 00:00:00 2001 +From: Nils Philippsen +Date: Thu, 15 Aug 2024 09:50:48 +0200 +Subject: [PATCH] plug-ins: Fix building TIFF loader on big endian +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +A recent addition to load layers in Sketchbook TIFFs contained a typo in +code specific to big endian machines, making it fail to build there, +which wasn’t caught in CI. + +In addition to this fix, use the appropriately named macro to convert +from little endian to big endian. + +Signed-off-by: Nils Philippsen +--- + plug-ins/file-tiff/file-tiff-load.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c +index 62988e793c..5988d2a77b 100644 +--- a/plug-ins/file-tiff/file-tiff-load.c ++++ b/plug-ins/file-tiff/file-tiff-load.c +@@ -1911,7 +1911,7 @@ load_rgba (TIFF *tif, + guint32 i; + + for (i = row_start; i < row_end; i++) +- buffer[i] = GUINT32_TO_LE (buffer[i]); ++ buffer[i] = GUINT32_FROM_LE (buffer[i]); + #endif + + gegl_buffer_set (channel[0].buffer, +@@ -2451,7 +2451,7 @@ load_sketchbook_layers (TIFF *tif, + + /* Make sure our channels are in the right order */ + for (i = row_start; i < row_end; i++) +- pixels[i] = GUINT32_TO_LE (pixel[i]); ++ pixels[i] = GUINT32_FROM_LE (pixels[i]); + #endif + gegl_buffer_set (buffer, + GEGL_RECTANGLE (0, layer_height - row - 1, +-- +2.46.0 + diff --git a/gimp.spec b/gimp.spec index 57d16ca..f701877 100644 --- a/gimp.spec +++ b/gimp.spec @@ -224,9 +224,15 @@ Patch2: gimp-2.99.19-no-phone-home-default.patch # use external help browser directly if help browser plug-in is not built Patch3: gimp-2.99.19-external-help-browser.patch -# Don’t require an unreleased gegl version: +# Don’t require an unreleased gegl version Patch4: 0001-Don-t-require-unreleased-gegl-version.patch +# Submitted upstream: + +# Fix building TIFF loader plug-in on big endian +# https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1778 +Patch5: 0001-plug-ins-Fix-building-TIFF-loader-on-big-endian.patch + %description GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other @@ -288,6 +294,7 @@ EOF %patch 2 -p1 -b .no-phone-home-default %patch 3 -p1 -b .external-help-browser %patch 4 -p1 -b .don-t-require-unreleased-gegl-version +%patch 5 -p1 -b .fix-building-tiff-loader-on-big-endian %build # Use hardening compiler/linker flags because gimp is likely to deal with files