简体   繁体   English

Windows和PNG文件下的Emacs

[英]Emacs under Windows and PNG files

Would anyone have any pointers on getting PNG images to display in Emacs 23 under Win32?.. I have installed the gnuwin32 set of utilities, including libpng and zlib; 任何人都有任何关于获取PNG图像以在Win32下的Emacs 23中显示的指示吗?..我已经安装了gnuwin32实用程序集,包括libpng和zlib; C:\\Program Files\\GnuWin32\\bin is in path. C:\\ Program Files \\ GnuWin32 \\ bin在路径中。 JPG files started working but not PNGs. JPG文件开始工作但不是PNG。 I'd appreciate any hints on getting this to work. 我很欣赏任何关于让它发挥作用的暗示。

EDIT: PNG thumbnails actually display fine (eg in dired via Ct Ct). 编辑:PNG缩略图实际上显示正常(例如通过Ct Ct在dired中)。 However, opening them fails (opens as garbage in fundamental mode, and Mx image-mode says "invalid image specification"). 但是,打开它们会失败(在基本模式下打开为垃圾,而Mx图像模式则表示“无效的图像规范”)。

You have to copy one of these dlls "libpng12d.dll" "libpng12.dll" "libpng.dll" "libpng13d.dll" "libpng13.dll" to your emacs-23.1/bin/ directory. 您必须将其中一个“libpng12d.dll”“libpng12.dll”“libpng.dll”“libpng13d.dll”“libpng13.dll”复制到您的emacs-23.1 / bin /目录中。 They require zlib1.dll which you have to copy as well. 他们需要zlib1.dll,你也必须复制。 I did the same thing for jpeg62.dll and giflib4.dll and now my emacs supports jpg, gif and png files. 我为jpeg62.dll和giflib4.dll做了同样的事情,现在我的emacs支持jpg,gif和png文件。 For some reason it does not work if I simply put these dlls in the path. 由于某种原因,如果我只是将这些dll放在路径中,它就不起作用。

You can check (image-type-available-p 'png) to see if png is supported. 您可以检查(image-type-available-p 'png)以查看是否支持png。 image-library-alist maps image type to a list of dlls which support it. image-library-alist将图像类型映射到支持它的dll列表。

According to the official manual: 根据官方手册:

3.3 How do I get image support? 3.3如何获得图像支持?

Emacs has built in support for XBM and PBM/PGM/PPM images. Emacs内置了对XBM和PBM / PGM / PPM图像的支持。 This is sufficient to see the monochrome splash screen and tool-bar icons. 这足以看到单色闪屏和工具栏图标。 Since 22.2, the official precompiled binaries for Windows have bundled libXpm, which is required to display the color versions of those images. 从22.2开始,Windows的官方预编译二进制文件捆绑了libXpm,这需要显示这些图像的颜色版本。

Emacs is compiled to recognize JPEG, PNG, GIF and TIFF images also, but displaying these image types require external DLLs which are not bundled with Emacs. 编译Emacs也可识别JPEG,PNG,GIF和TIFF图像,但显示这些图像类型需要外部DLL,这些DLL不与Emacs捆绑在一起。 See Other useful ports. 请参阅其他有用端口。

Those dlls for the various image formats are (as far as I know) - XPM (xpm4.dll), PNG (libpng13.dll, zlib1.dll), JPEG (jpeg62.dll), TIFF (libtiff3.dll) and GIF (giflib4.dll); 那些用于各种图像格式的dll(据我所知) - XPM(xpm4.dll),PNG(libpng13.dll,zlib1.dll),JPEG(jpeg62.dll),TIFF(libtiff3.dll)和GIF( giflib4.dll);

Starting with Emacs 25 the Emacs Windows download directory includes -deps zip packages, that can be extracted to your emacs installation folder and include image libraries for PNG, SVG, JPEG, GIF, TIFF and more. 从Emacs 25开始,Emacs Windows下载目录包含-deps zip包,可以解压缩到您的emacs安装文件夹,包括PNG,SVG,JPEG,GIF,TIFF等图像库。

See also this emacs.stackexchange answer . 另请参阅此emacs.stackexchange答案

要显示您的Emacs for Windows版本需要哪个版本的PNG dll,您可以评估(cdr (assq 'png dynamic-library-alist))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM