From 39e5d0c53c9289ebace46cdbd84c6973b61c87e5 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 19 Jul 2025 14:35:28 +0100 Subject: [PATCH] add a sniffer for the XWD format otherwise we mistake it for TGA see https://github.com/libvips/libvips/issues/4612 --- libvips/foreign/magick.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libvips/foreign/magick.c b/libvips/foreign/magick.c index 1cf7ef1ce9..876cab3f26 100644 --- a/libvips/foreign/magick.c +++ b/libvips/foreign/magick.c @@ -138,6 +138,15 @@ magick_sniff(const unsigned char *bytes, size_t length) (bytes[4] != 0 || bytes[5] != 0)) return "ICO"; + if (length >= 8 && + bytes[1] == 0 && + bytes[2] == 0 && + bytes[5] == 0 && + bytes[6] == 0 && + (bytes[4] == 7 || + bytes[7] == 7)) + return "XWD"; + if (length >= 18 && (bytes[1] == 0 || bytes[1] == 1) && pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy