all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Commands for viewing images
Date: Wed, 25 Feb 2009 11:04:05 -0800 (PST)	[thread overview]
Message-ID: <1fca0533-79e1-4af0-a220-7a676859320b@t3g2000yqa.googlegroups.com> (raw)
In-Reply-To: 87ljruptqp.fsf@mundaneum.com

On Feb 25, 4:48 am, Sébastien Vauban <zthjwsqqa...@spammotel.com>
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 “identify” to get the image dimension first, 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
∑ http://xahlee.org/

      parent reply	other threads:[~2009-02-25 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 12:48 Commands for viewing images Sébastien Vauban
2009-02-25 15:29 ` Tassilo Horn
2009-02-25 19:04 ` Xah Lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1fca0533-79e1-4af0-a220-7a676859320b@t3g2000yqa.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.