;+
; NAME
;	MREADGIF
; PURPOSE
;	To read in a lot of gif images at once, by analogy
;	to Freeland's MREADFITS.
; USAGE
;	Just like read_gif, except you can specify a list of
;	files to read in.
; METHOD
;	We assume you don't want to read in a whole bunch of unlike
;	gifs, so we use the quick-and-dirty assumption that all the
;	gifs are the same size as the first one.  We also assume they
;	all use the same color table (if any).
;	The first gif gets read, then an array is allocated and the remainder
;	are stuffed into it with read_gif.  The only reason that this isn't
;	completely trivial is the stoopid way IDL handles parameter passing:
;	you can't say read_gif,f(i),out(*,*,i) because out(*,*,i) gets passed
;	by VALUE then and not by REFERENCE.  
; AUTHOR
;	Craig DeForest 1-Dec-1998
;-
pro mreadgif,f,out,r,g,b

if(nlm(f) eq 1) then read_gif,f,out,r,g,b else begin
	read_gif,f(0),a,r,g,b
	out = bytarr(nlm(a(*,0)),nlm(a(0,*)),nlm(f))
	print,"% mreadgif: reading ",nlm(f)," files..."
	out(*,*,0) = a
	for i=1,nlm(f)-1 do begin
		read_gif,f(i),a
		out(*,*,i) = a
	end
end

end
