From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: image size limit? Date: Thu, 13 Oct 2005 16:13:31 -0400 Message-ID: References: <87oe5v7q19.fsf@stupidchicken.com> <87k6giiqh3.fsf@pacem.orebokech.com> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1129234647 20769 80.91.229.2 (13 Oct 2005 20:17:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Oct 2005 20:17:27 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 13 22:17:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQ9Su-0005ea-Dv for ged-emacs-devel@m.gmane.org; Thu, 13 Oct 2005 22:14:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQ9St-00056R-SI for ged-emacs-devel@m.gmane.org; Thu, 13 Oct 2005 16:14:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQ9Sk-00056L-5n for emacs-devel@gnu.org; Thu, 13 Oct 2005 16:14:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQ9Si-000569-GN for emacs-devel@gnu.org; Thu, 13 Oct 2005 16:14:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQ9Si-000565-CY for emacs-devel@gnu.org; Thu, 13 Oct 2005 16:14:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EQ9Sh-0000kM-OP for emacs-devel@gnu.org; Thu, 13 Oct 2005 16:13:59 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EQ9SF-0007Ve-SF; Thu, 13 Oct 2005 16:13:50 -0400 Original-To: Romain Francoise In-reply-to: <87k6giiqh3.fsf@pacem.orebokech.com> (message from Romain Francoise on Wed, 12 Oct 2005 19:40:08 +0200) 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:44002 Archived-At: For some image types, it is a simple matter of passing to the library the limits Emacs wants to set. For libpng, we could use png_set_user_limits() to set our maximum width/height. (libpng also has a built-in default limit of 1 million pixels in both dimensions.) For other libraries, the application can set the maximum amount of memory to allocate, see for example libjpeg's `max_memory_to_use' and `max_alloc_chunk'. Getting things right for all image types will probably be tricky... If we handle them one by one, it won't be terribly tricky. We could have one limit for memory size of an image, and another limit for the width and height as a ratio to those of the window. Then for each image type it would use whichever of those can be used. Would you like to implement this for some image types for which it is easy to do? Then we could ask the developers of the other libraries to add similar features.