all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: help with image handling
Date: Thu, 24 Mar 2005 13:45:35 -0600	[thread overview]
Message-ID: <E1DEYGt-0002HA-00@lab45.ma.utexas.edu> (raw)


I want to download images from the web and display them in 
an emacs buffer.  It seemed to me that the following form
should work, as an example of how to do this:

(let ((content (progn
                 (set-buffer (get-buffer-create "*scratch*"))
                 (url-insert-file-contents "http://www.gnu.org/graphics/gnu-head-sm.jpg")
                 (buffer-string)))
      (set-buffer (get-buffer-create "*Nero*"))
      (erase-buffer)
      (insert-image (create-image content 
                                  `,(nero-type-from-extension
                                     extension)
                                  t))))

However, when I switch to the *Nero* buffer, I just see a box,
not the actual image that I thought I was downloading.  What
should I be doing differently to actually get the image to display?


Note that this is in 

 GNU Emacs 22.0.50.4 (powerpc-apple-darwin7.5.0, X toolkit, Xaw3d scroll bars) of 2005-03-24


And the `nero-type-from-extension' function used above is defined here:

(defun nero-type-from-extension (extension)
  "Return the image type identifier associated with a file extension."
  (cdr (assoc extension '(("jpeg" . jpeg)
                          ("jpg" . jpeg)
                          ("xpm" . xpm)
                          ("xbm" . xbm)
                          ("gif" . gif)
                          ("eps" . postscript)
                          ("pbm" . pbm)
                          ("png" . png)
                          ("tiff" . tiff)))))

             reply	other threads:[~2005-03-24 19:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-24 19:45 Joe Corneli [this message]
     [not found] <mailman.153.1111695505.28103.help-gnu-emacs@gnu.org>
2005-03-24 20:40 ` help with image handling Miles Bader

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=E1DEYGt-0002HA-00@lab45.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /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.