From cc428e15c618d7fe5d4ab6923f78085490068d44 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 10 Dec 2025 16:24:55 +0100 Subject: add upstream fix for libraw < 0.21 add upstream fix for GraphicsMagick --- upstream.patch | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vips.spec | 15 +++++----- 2 files changed, 100 insertions(+), 8 deletions(-) diff --git a/upstream.patch b/upstream.patch index 8ce691c..1150e4a 100644 --- a/upstream.patch +++ b/upstream.patch @@ -24,3 +24,96 @@ index b809fae301..83055b7492 100644 magick_sniff_file(magick->image_info, filename); magick->image = ReadImage(magick->image_info, magick->exception); } +From 7470eb84b060eea0c6ece9b6f4add1f262b50445 Mon Sep 17 00:00:00 2001 +From: Kleis Auke Wolthuizen +Date: Tue, 9 Dec 2025 16:52:22 +0100 +Subject: [PATCH] Ensure compatibility with libraw < 0.21 + +Resolves: #4795. +--- + libvips/foreign/dcrawload.c | 19 +++++++++++++++++++ + meson.build | 3 ++- + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/libvips/foreign/dcrawload.c b/libvips/foreign/dcrawload.c +index 74bc5067be..c2c710937e 100644 +--- a/libvips/foreign/dcrawload.c ++++ b/libvips/foreign/dcrawload.c +@@ -133,8 +133,10 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + raw->raw_processor->idata.make); + vips_image_set_string(image, "raw-model", + raw->raw_processor->idata.model); ++#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 17) + vips_image_set_string(image, "raw-software", + raw->raw_processor->idata.software); ++#endif /*LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 17)*/ + vips_image_set_double(image, "raw-iso", + raw->raw_processor->other.iso_speed); + vips_image_set_double(image, "raw-shutter", +@@ -144,6 +146,9 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + vips_image_set_double(image, "raw-focal-length", + raw->raw_processor->other.focal_len); + ++ /* See also: vips__get_iso8601() ++ */ ++#if GLIB_CHECK_VERSION(2, 62, 0) + GDateTime *dt = + g_date_time_new_from_unix_utc(raw->raw_processor->other.timestamp); + if (dt) { +@@ -156,7 +161,18 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + + g_date_time_unref(dt); + } ++#else /*!GLIB_CHECK_VERSION(2, 62, 0)*/ ++ GTimeVal val = { raw->raw_processor->other.timestamp, 0 }; ++ ++ char *str = g_time_val_to_iso8601(&val); ++ if (str) { ++ vips_image_set_string(image, "raw-timestamp", str); ++ ++ g_free(str); ++ } ++#endif /*GLIB_CHECK_VERSION(2, 62, 0)*/ + ++#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 17) + if (raw->raw_processor->idata.xmpdata) + vips_image_set_blob_copy(image, VIPS_META_XMP_NAME, + raw->raw_processor->idata.xmpdata, +@@ -164,6 +180,7 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + + vips_image_set_string(image, "raw-lens", + raw->raw_processor->lens.Lens); ++#endif /*LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 17)*/ + + if (raw->raw_processor->color.profile) + vips_image_set_blob_copy(image, VIPS_META_ICC_NAME, +@@ -197,6 +214,7 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + } + vips_image_set_int(image, VIPS_META_ORIENTATION, orientation); + ++#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 21) + /* Search the available thumbnails for the largest that's smaller than + * the main image and has a known type. + */ +@@ -251,6 +269,7 @@ vips_foreign_load_dcraw_set_metadata(VipsForeignLoadDcRaw *raw, + raw->raw_processor->thumbnail.thumb, + raw->raw_processor->thumbnail.tlength); + } ++#endif /*LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 21)*/ + + return 0; + } +diff --git a/meson.build b/meson.build +index 6f2f8c02f1..7b3705a33d 100644 +--- a/meson.build ++++ b/meson.build +@@ -455,7 +455,8 @@ if openexr_dep.found() + cfg_var.set('HAVE_OPENEXR', true) + endif + +-libraw_dep = dependency('libraw_r', required: get_option('raw')) ++# require 0.14 for LIBRAW_COMPILE_CHECK_VERSION_NOTLESS ++libraw_dep = dependency('libraw_r', version: '>=0.14', required: get_option('raw')) + if libraw_dep.found() + external_deps += libraw_dep + cfg_var.set('HAVE_LIBRAW', true) diff --git a/vips.spec b/vips.spec index a139b14..a5604c3 100644 --- a/vips.spec +++ b/vips.spec @@ -34,6 +34,7 @@ %bcond_without jxl %bcond_without tests %bcond_without openjpeg2 +%bcond_without libraw %if 0%{?fedora} || 0%{?rhel} >= 9 %bcond_without imath @@ -41,12 +42,6 @@ %bcond_with imath %endif -%if 0%{?fedora} || 0%{?rhel} >= 9 -%bcond_without libraw -%else -%bcond_with libraw -%endif - %if 0%{?fedora} || 0%{?rhel} >= 9 %bcond_without highway %else @@ -70,7 +65,7 @@ Name: vips Version: %{vips_version}%{?vips_prever:~%{vips_prever}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: C/C++ library for processing large images License: LGPL-2.1-or-later @@ -132,7 +127,7 @@ BuildRequires: libimagequant-devel BuildRequires: pkgconfig(cgif) %endif %if %{with libraw} -BuildRequires: pkgconfig(libraw) +BuildRequires: pkgconfig(libraw) >= 0.14 %endif %if %{with tests} # bc command used in test suite @@ -500,6 +495,10 @@ export CXXFLAGS="%{optflags} -ftree-vectorize" %changelog +* Wed Dec 10 2025 Remi Collet - 8.18.0~rc2-2 +- add upstream fix for libraw < 0.21 +- add upstream fix for GraphicsMagick + * Tue Dec 9 2025 Remi Collet - 8.18.0~rc2-1 - update to 8.18.0-rc2 - switch from libspng to libpng (preferred upstream) -- cgit