From xemacs-m  Tue Mar 18 09:02:47 1997
Received: from newman (root@newman.aventail.com [38.225.141.10])
	by xemacs.org (8.8.5/8.8.5) with SMTP id JAA09309
	for <xemacs-beta@xemacs.org>; Tue, 18 Mar 1997 09:02:46 -0600 (CST)
Received: from kramer.in.aventail.com.aventail.com (wmperry@kramer [192.168.1.12]) by newman (8.6.12/8.6.9) with SMTP id HAA05720; Tue, 18 Mar 1997 07:00:11 -0800
Date: Tue, 18 Mar 1997 07:00:11 -0800
Message-Id: <199703181500.HAA05720@newman>
From: "William M. Perry" <wmperry@aventail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Darrell Kindred <dkindred@cmu.edu>
Cc: xemacs-beta@xemacs.org
Subject: Re: GIF-handling patch
In-Reply-To: <9703180734.AA30471@GS213.SP.CS.CMU.EDU>
References: <9703180734.AA30471@GS213.SP.CS.CMU.EDU>
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;

Darrell Kindred writes:

>David Moore's fix for the GIF crashes will almost certainly work, and it's
>nice and small, but I think the one below may be preferable.  Here's the
>deal, as I see it:
>
>The our_own_dgif_slurp_from_gif2x11_c() function makes an attempt to deal
>with multi-image GIF files, and with the `Top' & `Left' specs that images
>after the first can have.  It does so in a pretty weird way though, and
>winds up writing outside the allocated area when Top or Left is non-zero.
>Since XEmacs doesn't yet support multi-frame gifs, we can just ignore all
>but the first image, and this is what David's patch does.
>
>My patch scraps our_own_dgif_slurp_from_gif2x11_c() entirely, and reverts
>to using the regular DGifSlurp().  The reason for the existence of the
>former function was that DGifSlurp() "doesn't handle interlaced files."
>This isn't quite true though--it sets the `Interlace' flag properly, but
>the bits are stored in interlaced order.  My patch undoes the interlacing
>when the corresponding X image is created.

  This patch works great - its what I should have done in the first place
when getting interlaced images working properly, but that was an afternoons
hacking on code I didn't really want to understand all that much.  Sort of
like the JPEG code. :)

  What we need to do is have a nicely defined interface that we use for all
image loading, and then it should be much easier to write img-*.c and
register them easily with the core emacs code.  The next logical step would
be dynamically loading them.

  Anyone know what the status is on autoconf2 support?  I've got all the
cruft written to detect and deal with dynamic loading on 12 different
platforms just waiting....

-Bill P.

*** dgif_lib.c	1997/03/18 14:59:50	1.1
--- dgif_lib.c	1997/03/18 14:59:54
***************
*** 931,939 ****
  
  		sp = &GifFile->SavedImages[GifFile->ImageCount-1];
  		ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
- 
- 		fprintf(stderr,"Image: %d x %d\n",sp->ImageDesc.Width,
- 			sp->ImageDesc.Height);
  		sp->RasterBits
  		    = (GifPixelType*) xmalloc(ImageSize * sizeof(GifPixelType));
  
--- 931,936 ----

