|
From: | Tom |
Subject: | Fetching an image from the net and inserting into the buffer |
Date: | Sat, 25 Oct 2014 06:54:14 +0000 (UTC) |
User-agent: | Loom/3.14 (http://gmane.org/) |
I tried this code which when evaluated should insert the image fetched from the net at point, but it inserts a rectangle instead: (insert-image (with-current-buffer (url-retrieve-synchronously "http://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png") (goto-char (point-min)) (search-forward "\n\n") ;skip headers (create-image (buffer-substring (point) (point-max)) 'png))) It's emacs 24.1.1 on windows. Image are supported. If I download the image from the above URL to a file and use create-image on that file then it displays properly. But why doesn't it work when I try to fetch it dynamically with url retrieve?
[Prev in Thread] | Current Thread | [Next in Thread] |