help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with image handling


From: Miles Bader
Subject: Re: help with image handling
Date: Fri, 25 Mar 2005 05:40:27 +0900

Joe Corneli <jcorneli@math.utexas.edu> writes:
> 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?

It seems to be some sort of unibyte/multibyte confusion bogosity (not
sure if the code in url-*.el or mm-*.el really does that sort of thing
well or not).

If you do (set-buffer-multibyte nil) in your temp buffer before
downloading the contents, it should work; e.g. the following
successfully inserts a GNU head image for me:

   (insert-image
    (create-image
     (with-temp-buffer
       (set-buffer-multibyte nil)
       (url-insert-file-contents "http://www.gnu.org/graphics/gnu-head-sm.jpg";)
       (buffer-string))
     nil t))

[Note the third arg to `create-image' tells it to try deducing the image
type from the data in the image.]

-Miles
-- 
"Unless there are slaves to do the ugly, horrible, uninteresting work, culture
and contemplation become almost impossible. Human slavery is wrong, insecure,
and demoralizing.  On mechanical slavery, on the slavery of the machine, the
future of the world depends." -Oscar Wilde, "The Soul of Man Under Socialism"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]