From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Commands for viewing images Date: Wed, 25 Feb 2009 11:04:05 -0800 (PST) Organization: http://groups.google.com Message-ID: <1fca0533-79e1-4af0-a220-7a676859320b@t3g2000yqa.googlegroups.com> References: <87ljruptqp.fsf@mundaneum.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1235637404 29933 80.91.229.12 (26 Feb 2009 08:36:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Feb 2009 08:36:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 26 09:38:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lcbkk-0003IK-Qw for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Feb 2009 09:37:59 +0100 Original-Received: from localhost ([127.0.0.1]:40010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcbjQ-0007Lt-1v for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Feb 2009 03:36:36 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!t3g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1235588646 7875 127.0.0.1 (25 Feb 2009 19:04:06 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 25 Feb 2009 19:04:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t3g2000yqa.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167072 X-Mailman-Approved-At: Thu, 26 Feb 2009 03:35:32 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62390 Archived-At: On Feb 25, 4:48 am, S=C3=A9bastien Vauban wrote: > Hello, > > I view more and more image files from within Emacs, be it from a > Dired buffer, or as an attachment in a mail that I view in Gnus. > > My problem is: how can we zoom (out, mainly) the picture? > > It doesn't seem to be any way to do so in the `image-mode'. > Though, it should be possible as similar functions already have > been implemented for the `doc-view' package. Is there a package > I should know of, that would take care of adding zooming > commands when viewing buffers with pictures? i have no idea how zoom can be implemented as shown in typical image viewers. I suppose it's recompute the bitmap and redisplay. Note that in many browsers, Opera for example, you can zoom the whole page. (i.e. not the same as changing font size) This feature is in Mathematica IDE too (aka Frontend), since early 1990s. i doubt this feature could easily fit into emacs, probably require huge coding effort to its core. as a workaround, you could have elisp wrapper that call image magic to create a resized file as temp and display that. e.g. convert -scale 50% girl.jpg girl-s.jpg you could also call =E2=80=9Cidentify=E2=80=9D to get the image dimension f= irst, then some function in emacs to get the emacs window size, so that you can use the proper scale factor to make the image fit to window. here's a elisp that gets img dimension in pure elisp (defun get-image-dimensions (img-file-relative-path) "Returns a image file's width and height as a list." (let (tmp dimen) (clear-image-cache) (setq tmp (create-image (concat default-directory img-file-relative- path))) (setq dimen (image-size tmp t)) (list (car dimen) (cdr dimen)) ) ) probably best just to view it in a dedicated image viewer. You can easily write a elisp so that pressing a button shows the image in a external app. (i suppose this is already in image-mode?) Xah =E2=88=91 http://xahlee.org/ =E2=98=84