From 5df3ff0598ad8c8b659cce646d62ed56fe8da530 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 10 Dec 2025 13:10:02 +0100 Subject: [PATCH] Allow running test suite without libuhdr --- spec/image_spec.rb | 2 +- spec/spec_helper.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/image_spec.rb b/spec/image_spec.rb index 05c4b36..7837d4c 100644 --- a/spec/image_spec.rb +++ b/spec/image_spec.rb @@ -727,7 +727,7 @@ end # added in 8.18 - if Vips.respond_to? :vips_image_get_gainmap + if has_uhdr? it "can modify gainmaps" do # test the example code in image.rb doc comment for get_gainmap def modify_gainmap image diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 76227b0..10859ae 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,11 +23,15 @@ def timg(name) end def has_jpeg? - Vips.type_find("VipsOperation", "jpegload") != nil + Vips.type_find("VipsOperation", "jpegload") != 0 end def has_svg? - Vips.type_find("VipsOperation", "svgload") != nil + Vips.type_find("VipsOperation", "svgload") != 0 +end + +def has_uhdr? + Vips.type_find("VipsOperation", "uhdrload") != 0 end RSpec.configure do |config|