all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Some images make Emacs behave strangely
@ 2010-08-29 15:20 Lars Magne Ingebrigtsen
  2010-08-30  1:17 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-29 15:20 UTC (permalink / raw
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

Here's an image from the pheedo web tracking ad thingie whatever:

[larsi@quimbies ~/pgnus]$ file /tmp/a
/tmp/a: GIF image data, version 89a, 1 x 1

However:

(image-size (create-image "/tmp/a") t)
=> (30 . 30)

And inserting that image into the buffer yields an empty 30x30 box:

(put-image (create-image "/tmp/a") (point))

In addition, the rest of the text in entire buffer starts shaking and
shivering, and the cursor disappears.

So something is just not right, I think.

Here's the GIF in question:


[-- Attachment #2: a --]
[-- Type: image/gif, Size: 42 bytes --]

[-- Attachment #3: Type: text/plain, Size: 103 bytes --]


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen

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

* Re: Some images make Emacs behave strangely
  2010-08-29 15:20 Some images make Emacs behave strangely Lars Magne Ingebrigtsen
@ 2010-08-30  1:17 ` Chong Yidong
  2010-08-30  2:49   ` Lars Magne Ingebrigtsen
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chong Yidong @ 2010-08-30  1:17 UTC (permalink / raw
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Here's an image from the pheedo web tracking ad thingie whatever:
>
> [larsi@quimbies ~/pgnus]$ file /tmp/a
> /tmp/a: GIF image data, version 89a, 1 x 1
>
> However:
>
> (image-size (create-image "/tmp/a") t)
> => (30 . 30)
>
> And inserting that image into the buffer yields an empty 30x30 box:
>
> (put-image (create-image "/tmp/a") (point))

Emacs fails to load the image, because DGifSlurp returns GIF_ERROR when
we try to load its contents into memory.  I dunno what else we could do
to avoid failing (or why the GIMP seems to be able to handle this gif).

If I create a 1x1 gif file using the GIMP, Emacs can read it perfectly.



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

* Re: Some images make Emacs behave strangely
  2010-08-30  1:17 ` Chong Yidong
@ 2010-08-30  2:49   ` Lars Magne Ingebrigtsen
  2010-08-30  8:35   ` David Kastrup
  2010-08-30 16:59   ` Andreas Schwab
  2 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30  2:49 UTC (permalink / raw
  To: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Emacs fails to load the image, because DGifSlurp returns GIF_ERROR when
> we try to load its contents into memory.  I dunno what else we could do
> to avoid failing (or why the GIMP seems to be able to handle this gif).

Shouldn't `create-image' just return nil in that case, instead of
returning something that acts as an image?  I mean, that what
`create-image' does when you point it at something that isn't an image
at all, and this case should be no different...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Some images make Emacs behave strangely
  2010-08-30  1:17 ` Chong Yidong
  2010-08-30  2:49   ` Lars Magne Ingebrigtsen
@ 2010-08-30  8:35   ` David Kastrup
  2010-08-30 16:59   ` Andreas Schwab
  2 siblings, 0 replies; 5+ messages in thread
From: David Kastrup @ 2010-08-30  8:35 UTC (permalink / raw
  To: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
>> Here's an image from the pheedo web tracking ad thingie whatever:
>>
>> [larsi@quimbies ~/pgnus]$ file /tmp/a
>> /tmp/a: GIF image data, version 89a, 1 x 1
>>
>> However:
>>
>> (image-size (create-image "/tmp/a") t)
>> => (30 . 30)
>>
>> And inserting that image into the buffer yields an empty 30x30 box:
>>
>> (put-image (create-image "/tmp/a") (point))
>
> Emacs fails to load the image, because DGifSlurp returns GIF_ERROR when
> we try to load its contents into memory.  I dunno what else we could do
> to avoid failing (or why the GIMP seems to be able to handle this gif).

The question is not how to avoid failing, but how make Emacs accept
failure.  Emacs goes into a busy, display-thrashing loop making it
rather unresponsive.

-- 
David Kastrup




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

* Re: Some images make Emacs behave strangely
  2010-08-30  1:17 ` Chong Yidong
  2010-08-30  2:49   ` Lars Magne Ingebrigtsen
  2010-08-30  8:35   ` David Kastrup
@ 2010-08-30 16:59   ` Andreas Schwab
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2010-08-30 16:59 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Emacs fails to load the image, because DGifSlurp returns GIF_ERROR when
> we try to load its contents into memory.  I dunno what else we could do
> to avoid failing (or why the GIMP seems to be able to handle this gif).

GIMP also complains about the invalid image.  It is missing the
terminate record (try appending a semicolon to the file).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

end of thread, other threads:[~2010-08-30 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-29 15:20 Some images make Emacs behave strangely Lars Magne Ingebrigtsen
2010-08-30  1:17 ` Chong Yidong
2010-08-30  2:49   ` Lars Magne Ingebrigtsen
2010-08-30  8:35   ` David Kastrup
2010-08-30 16:59   ` Andreas Schwab

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.