Subject: bug#76462: 30.1; Test failure in image-type-from-file-name

From: Ulrich Müller <[email-masked]>
Date: Fri, 21 Feb 2025 10:08:24 +0100

>>>>> On Fri, 21 Feb 2025, Eli Zaretskii wrote:

> I cannot reproduce this, FWIW.

AFAICS this is triggered by either the --without-jpeg or --without-png
configure option.

Attached patch fixes the problem for me.

>From aba28057375113ea15710ac4a38a1be7dc37b9b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email-masked]>
Date: Fri, 21 Feb 2025 09:58:16 +0100
Subject: [PATCH] ; Skip image type test if support is missing

* test/lisp/image-tests.el (image-type-from-file-name): Skip if
image types are not available.  (Bug#76462)
---
 test/lisp/image-tests.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index 69557c83657..03d20758052 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -88,6 +88,9 @@ image-supported-file-p/unsupported-returns-nil
   (should-not (image-supported-file-p "foo.some-unsupported-format")))
 
 (ert-deftest image-type-from-file-name ()
+  (skip-unless (and (image-type-available-p 'jpeg)
+                    (image-type-available-p 'png)
+                    (image-type-available-p 'webp)))
   (with-suppressed-warnings ((obsolete image-type-from-file-name))
     (should (eq (image-type-from-file-name "foo.jpg") 'jpeg))
     (should (eq (image-type-from-file-name "foo.png") 'png))
-- 
2.48.1