From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Dokos Newsgroups: gmane.emacs.help Subject: Displaying images does not always work - why not? Date: Mon, 6 Jun 2011 22:53:30 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307401365 31020 80.91.229.12 (6 Jun 2011 23:02:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 23:02:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 07 01:02:41 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QTioh-0004Mt-OD for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Jun 2011 01:02:39 +0200 Original-Received: from localhost ([::1]:32928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTiog-0003xZ-Cs for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Jun 2011 19:02:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTimN-0003wf-KE for help-gnu-emacs@gnu.org; Mon, 06 Jun 2011 19:00:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTimL-00009u-E4 for help-gnu-emacs@gnu.org; Mon, 06 Jun 2011 19:00:15 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:50228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTimK-00009e-QB for help-gnu-emacs@gnu.org; Mon, 06 Jun 2011 19:00:13 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QTimE-0003PD-88 for help-gnu-emacs@gnu.org; Tue, 07 Jun 2011 01:00:06 +0200 Original-Received: from zcce02cs1744-db20.houston.hp.com ([15.203.233.78]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jun 2011 01:00:06 +0200 Original-Received: from nicholas.dokos by zcce02cs1744-db20.houston.hp.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jun 2011 01:00:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 58 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 15.203.233.78 (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81302 Archived-At: I had some trouble with Julien Danjou's nifty google-weather and its corollary org-google-weather (available from Julien's git repo git://git.naquadah.org/google-weather-el.git), but most of it turned out to be some volatility in what Google provides. There is a remaining problem however that is driving me up the wall. Org-google-weather downloads and displays weather information, including GIF images (partly cloudy etc). It also caches both the information and the images for 12 hours. When the information is displayed, sometimes the images are fine, but most of the time they are empty boxes. Turns out that if I defeat the caching and download the images from Google they display properly. If I try to display a cached image, I get the empty box. Here is what I tried: (setq date '(6 6 2011)) (setq foo (let ((org-google-weather-cache-time 0)) (org-google-weather))) (setq bar (org-google-weather)) (equal foo bar) returns t. Evaluating foo and bar in separate windows and running compare-windows also says they are the same. Doing C-u C-x = and clicking on the display property of each and comparing them shows no difference. Nevertheless (insert foo) displays the image, whereas (insert bar) displays an empty box. I tried to reduce it to more elemental components, by saving the image part of the cached file into a different file, called foo.gif. I can display that using ImageMagick's "display" program (although when I open it in emacs, I get the binary content). I converted it to a PNG, usinc convert: I can display the PNG using "display" and I can also open it in emacs: I get the image displayed. But when I try (setq i (create-image "foo.png")) (insert-image i) I get the dreaded empty box (and the same thing with foo.gif). And btw, image-type-available-p says t for both gif and png. What am I missing? Thanks, Nick PS. I tried with both emacs 24.0.50 and emacs 23.1.1 and get the same result in this last case. If you care to try it out, I've put the foo.png file at http://free.linux.hp.com/~nick/foo.png