Thursday 30 January 2003

Image Support in Emacs


If you've been watching the CVS commits lately, you'll have
noticed that there has been a flurry of activity recently
concerning image support for Windows.



So how do you get this going?


Compiling



Image support will be compiled in if the necessary headers
are in your include path. You can extend the include
path for msvc by setting the INCLUDE environment
variable. For gcc, the INCLUDEPATH environment
variable has the same purpose. An alternative for both
compilers is to specify --with-cflags "-I ..."
when running the configure.bat script.



If you don't want support for an image format for some
reason (eg bugginess), you can force configure.bat to
skip detecting that library. There are
--without-... options for all image formats that
use external libraries.



Dependencies


The PNG library also depends on zlib, at both
compile and run time. TIFF depends on JPEG at run time,
but it is possible to compile an Emacs with TIFF support
without the JPEG headers. There appear to be some
incompatibilities between some binary versions of
libraries. The safest option is to compile the libraries
yourself, then use the headers from those versions
(which may include configuration info) to build Emacs.



Running



Emacs uses DLL versions of the image libraries. You can
compile these yourself, or download them from the
GnuWin32
project (the DLLs are in the ...-bin.zip packages) or
elsewhere.



An alternative to libXpm is elisp XPM support written
by Oliver Scholz, with some modifications by me to
support the splash-screen. Oliver's original version can
be found in the emacs-devel archives on mail.gnu.org,
my modified versions are below (mostly in image-add.el,
but there may be some differences in xpm.el):




Usage: (require 'image-add)

No comments: