unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: imagemagick format detection code
Date: Sun, 11 Aug 2013 23:14:38 +0200	[thread overview]
Message-ID: <m361vchqv5.fsf@stories.gnus.org> (raw)

duckduckgo outputs images as gzipped .ico files, and eww can now almost
display them.  But!  If I create the image from the data in the buffer,
I just get a square which imagemagick uses to tell us "nuh-huh; don't
understand": 

(with-temp-buffer
  (set-buffer-multibyte nil)
  (insert-file-contents-literally "/tmp/b.ico")
  (let ((image (create-image (buffer-string) 'imagemagick t)))
    (pop-to-buffer "*image*")
    (insert-image image "*")))

However, if I create the image with

(create-image "/tmp/b.ico" 'imagemagick)

then it works fine.

Does anybody have any, er, insights to offer here?

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html




             reply	other threads:[~2013-08-11 21:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-11 21:14 Lars Magne Ingebrigtsen [this message]
2013-08-11 21:27 ` imagemagick format detection code Lars Magne Ingebrigtsen
2013-08-12  1:06   ` Stefan Monnier
2013-08-12 15:17     ` Lars Magne Ingebrigtsen
2013-08-12 17:43       ` Thien-Thi Nguyen
2013-08-13 14:23       ` Stefan Monnier
2013-08-13 18:14         ` Lars Magne Ingebrigtsen
2013-08-13 18:19           ` Lars Magne Ingebrigtsen
2013-08-13 18:56           ` Stefan Monnier
2013-08-13 19:05             ` Lars Magne Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m361vchqv5.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).