all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help with image handling
@ 2005-03-24 19:45 Joe Corneli
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Corneli @ 2005-03-24 19:45 UTC (permalink / 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)))))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-24 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.153.1111695505.28103.help-gnu-emacs@gnu.org>
2005-03-24 20:40 ` help with image handling Miles Bader
2005-03-24 19:45 Joe Corneli

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.