From a6abb6f5cdd5a44bce2e42c340a6c6b83579de93 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 26 Mar 2022 11:31:46 +0300 Subject: [PATCH] Support display of BMP images on MS-Windows * src/w32image.c (w32_can_use_native_image_api): Support BMP images. * src/image.c (syms_of_image) : New symbol. [HAVE_NTGUI]: Add 'bmp' to list of supported image types. * doc/lispref/display.texi (Image Formats): Document built-in support for BMP images. * etc/NEWS: Announce the change. --- doc/lispref/display.texi | 6 ++++++ etc/NEWS | 5 +++++ src/image.c | 2 ++ src/w32image.c | 1 + 4 files changed, 14 insertions(+) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 3aec06e13dd..2dc0ef4c0ba 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -5507,6 +5507,12 @@ symbol}. The symbols for the above formats are, respectively, @code{pbm}, @code{xbm}, @code{xpm}, @code{gif}, @code{jpeg}, @code{tiff}, @code{png}, @code{svg}, and @code{webp}. + On some platforms, the built-in image support that doesn't require +any optional libraries includes BMP images.@footnote{ +On MS-Windows, this requires @code{w32-use-native-image-API} to be set +non-@code{nil}. +} + Furthermore, if you build Emacs with ImageMagick (@code{libMagickWand}) support, Emacs can display any image format that ImageMagick can. @xref{ImageMagick Images}. All images diff --git a/etc/NEWS b/etc/NEWS index d26c6568b9b..f726b0a2e84 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1821,6 +1821,11 @@ follow the system's dark mode: GUI frames use the appropriate light or dark title bar and scroll bars, based on the user's Windows-wide color settings. ++++ +*** Emacs now supports display of BMP images using native image APIs. +When 'w32-use-native-image-API' is non-nil, Emacs on MS-Windows now +has built-in support for displaying BMP images. + ---------------------------------------------------------------------- This file is part of GNU Emacs. diff --git a/src/image.c b/src/image.c index c412dc90296..d44d6890846 100644 --- a/src/image.c +++ b/src/image.c @@ -11558,6 +11558,8 @@ non-numeric, there is no explicit limit on the size of images. */); # ifdef HAVE_NTGUI DEFSYM (Qgdiplus, "gdiplus"); DEFSYM (Qshlwapi, "shlwapi"); + DEFSYM (Qbmp, "bmp"); + add_image_type (Qbmp); # endif #endif diff --git a/src/w32image.c b/src/w32image.c index f3374dcfd30..1f7c4921b31 100644 --- a/src/w32image.c +++ b/src/w32image.c @@ -253,6 +253,7 @@ w32_can_use_native_image_api (Lisp_Object type) || EQ (type, Qpng) || EQ (type, Qgif) || EQ (type, Qtiff) + || EQ (type, Qbmp) || EQ (type, Qnative_image))) { /* GDI+ can also display BMP, Exif, ICON, WMF, and EMF images. -- 2.39.2