From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: image size limit? Date: Wed, 19 Oct 2005 08:45:39 -0400 Message-ID: <87ach5wu8c.fsf@stupidchicken.com> References: <87oe5v7q19.fsf@stupidchicken.com> <87k6giiqh3.fsf@pacem.orebokech.com> <87hdbht7v9.fsf@stupidchicken.com> <87d5m3zu20.fsf@stupidchicken.com> <85ek6hitq3.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129737261 10055 80.91.229.2 (19 Oct 2005 15:54:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Oct 2005 15:54:21 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , rms@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 19 17:54:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ESGEB-0003l2-AJ for ged-emacs-devel@m.gmane.org; Wed, 19 Oct 2005 17:51:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESGEA-0002LC-PK for ged-emacs-devel@m.gmane.org; Wed, 19 Oct 2005 11:51:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ESDLX-0000gu-7a for emacs-devel@gnu.org; Wed, 19 Oct 2005 08:47:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ESDLQ-0000aL-UB for emacs-devel@gnu.org; Wed, 19 Oct 2005 08:47:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESDKd-0008Ij-Rm for emacs-devel@gnu.org; Wed, 19 Oct 2005 08:46:11 -0400 Original-Received: from [18.95.6.101] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ESDKC-0005Zi-B5; Wed, 19 Oct 2005 08:45:44 -0400 Original-Received: by localhost.localdomain (Postfix, from userid 1000) id A54E51E42BC; Wed, 19 Oct 2005 08:45:39 -0400 (EDT) Original-To: David Kastrup In-Reply-To: <85ek6hitq3.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 19 Oct 2005 14:20:20 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:44322 Archived-At: David Kastrup writes: >> But it definitely sounds better to scale according to display size >> rather than frame size (but round up to minimum size e.g. 4096x4096). > > It sounds to me like the limits should be configurable, with a > somewhat conservative default. Applications where larger dimensions > might be appropriate (image viewers with provisions for panning, i.e.) > can allow them in their own buffers using buffer-local settings of the > variables limiting the size. Scaling according to display size isn't entirely problem-free either, because Emacs frames can be put on different X displays ;-) I think scaling according to frame size is not a great solution, but it's OK because of the way image loading works. If the frame is initially too small, Emacs won't load the image. But each time you increase the size of the frame, Emacs checks again, and loads the image if the size relative to the frame is now OK. Once an image is loaded, it's put in the image cache, so it will always be displayed regardless of the frame size. The max-image-size code is checked into CVS. I've set a conservative value of 6.0 times the frame width and height. After all, the original rationale for this feature is to avoid over-allocating memory in case a malicious image demands a gigantic image widths/heights of millions of pixels. In ordinary situations, it shouldn't get in the way of the user.