From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: DJVU files and ImageMagick Date: Sat, 02 Feb 2019 23:12:12 +0100 Message-ID: <87zhrdn8lf.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="161482"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 02 23:13:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gq3X4-000ftw-WC for ged-emacs-devel@m.gmane.org; Sat, 02 Feb 2019 23:13:03 +0100 Original-Received: from localhost ([127.0.0.1]:48535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq3X3-00072W-ST for ged-emacs-devel@m.gmane.org; Sat, 02 Feb 2019 17:13:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq3WP-00072L-LN for emacs-devel@gnu.org; Sat, 02 Feb 2019 17:12:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gq3WM-0006oS-2E for emacs-devel@gnu.org; Sat, 02 Feb 2019 17:12:19 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:48467) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gq3WL-0006nh-Le for emacs-devel@gnu.org; Sat, 02 Feb 2019 17:12:18 -0500 Original-Received: from rosalinde ([188.109.164.123]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MBq8p-1gxVlK38jv-00AoxV for ; Sat, 02 Feb 2019 23:12:13 +0100 X-Provags-ID: V03:K1:xB7YRt2T3RCYdI5OpSozQAm5UlDDzBEOuK6ZopsCoHtEmqQDK1n DFfKBYFaC0w+WHUkYBk4GJQHRkdfSbeMfYJGTgw93fhI5A2VIcw+GMYbp3ScIMv+H13mZEt C3LQgFf7igjZXG8Z15hr4x4ivAKBCT/oOCe2hAte7NXjDuMlSqerDUsRon5KGpGT3bpyg+F sb6xuJuTSxEGAAqJK/1ug== X-UI-Out-Filterresults: notjunk:1;V03:K0:VSwUPQXsCNo=:pxCUqb8xRd279eObAsQiYW OiMA7druOVLxekgC8jwGi5tVUil2OPAoHuyO9nbzMEAbhD5oeDeTXTvzAjTRF3qgeC2UfIHdI O6heuE1iLPQ+2N6T755hfhcdV/EVju9EKCjfDMHHXF6QyzKsr953Rvoffb/yWPMbeLJEnKZ9w nkbTye1F02LYmgMak1N5v4rLf+CLrBTl/O188VoRggfbukdKyj8Tb8om2pNeV6eyTqbaEx0q1 EqVS0myMEvJA2R7mZtibwdPmD9raRKPrlXffyI4Qei/uuJKxpSOV5njS6UN5mVBx2JakcwAYR 0nk/2og9jgEqTzE7/gPIdxcfcxzM5JFbSUVix/TPHsniADgK2v1hMH7ER8oQaTBroToGZqFzK iRWSiDfZQZoFungiBnHYsbibJAa0cw4+3qxoqF4BZzayg1txaSJh+b0xfJVWXDt8Zv0eUrvRe /soKGtJ3J6vmUD6swZcQijPCKZo3M9Tl7brmnJUXOH4pGZDXUVvp5kh4G5YK5JBZkYLq6jSBW c1HfwKh5rXVITXepc/78ihEMFcJfYWeI8wHLHrPQa4k+ZD5caKhmdNS06hGx8ZnvZgP5mMfSK YyRA8WE1N5bReW7/Vn+D15pbDZoMb822nUX4bQonDWKkZgDwuutWrZ5uefJ96gFjS1/1wkQW+ +vie7eqlC5yjHBRlWUAlygq5+DvELqS4CuTQB1sT1hSPAxbnCMgUtocYqZGEJIghROsu9m086 9Vm0eSbzqxC9W9ESJRV35cp0MXFoQqXJsVIgDqFbw8YeNA5s8HGqr4Lzj3hDrDBAafShGASZ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232916 Archived-At: Should the following change be made? diff --git a/lisp/image.el b/lisp/image.el index 3aa3b0aa24..ba75bdf034 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -902,7 +902,7 @@ imagemagick-register-types (setq imagemagick--file-regexp re)))) (defcustom imagemagick-types-inhibit - '(C HTML HTM INFO M TXT PDF) + '(C HTML HTM INFO M TXT PDF DJVU) "List of ImageMagick types that should never be treated as images. This should be a list of symbols, each of which should be one of the ImageMagick types listed by `imagemagick-types'. The listed Here's my reason for asking: If Emacs is built without ImageMagick support and the ddjvu program (from DjVuLibre) is found, DJVU files are automatically (via auto-mode-alist) displayed in doc-view-mode. If Emacs is built with ImageMagick support (version 6 or 7), image-mode is used to display DJVU files, because DJVU is one of the images type imagemagick-register-types assigns to image-mode and adds the corresponding entry to auto-mode-alist before the entry using doc-view-mode-maybe. I build Emacs from master with ImageMagick support, but if I try to visit a DJVU file (e.g. a ca. 200 page book of about 1.5 MB), immediately almost all my system's RAM is consumed, bringing Emacs to a halt, so it doesn't display the file, and I can recover the memory only by killing Emacs. In contrast, when I open the same DJVU file from the shell using the ImageMagick 'display' command, it also uses most of the system memory for a number of seconds but then does display the file and I can exit the program normally and recover the memory. (This is with ImageMagick 7; I also tried it on another system using ImageMagick 6 and there, but using 'display' from the shell was the same as the Emacs behavior: almost all memory was consumed and the process had to be killed.) Can anyone here visit a comparably sized DJVU file in Emacs built with ImageMagick and have it displayed? If so, maybe my system just lacks sufficient memory (it has 4GB RAM + 1 GB swap) -- though that doesn't explain the difference between 'display' and Emacs+ImageMagick with ImageMagick 7. I can prevent Emacs from using ImageMagick with DJVU by customizing either imagemagick-types-inhibit or imagemagick-enabled-types, but if this is a general issue, maybe the default value of one of these should be changed to prevent using ImageMagick with DJVU files. I see that by default, PDF is in both lists, whereas DJVU is only in the latter (which comes from imagemagick-types according to what ImageMagick itself claims to support). And indeed, when I try to open a PDF file from the shell with 'display', the process aborts, so I infer that's why PDF was added to imagemagick-types-inhibit, and hence, if the problem with DJVU I see is general, the same thing should be done for this file type (i.e., the above patch). (I normally view DJVU files in Emacs using the djvu package from ELPA, which like doc-view uses DjVuLibre programs, not ImageMagick, so it doesn't have this issue; but if I use C-x C-f or Dired to visit a DJVU file, I get the problem.) If this is just a problem of too little memory, an alternative to changing the default value of imagemagick-types-inhibit is to add a note to etc/PROBLEMS suggesting to customize this user option. Steve Berman