IMG_tif.c
changeset 117 e613cf987897
parent 98 9f94c4674cc9
child 118 c5e736a47ad2
     1.1 --- a/IMG_tif.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_tif.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -77,9 +77,14 @@
     1.4  
     1.5  int IMG_isTIF(SDL_RWops* src)
     1.6  {
     1.7 +	int start;
     1.8 +	int is_TIF;
     1.9  	TIFF* tiff;
    1.10  	TIFFErrorHandler prev_handler;
    1.11  
    1.12 +	start = SDL_RWtell(src);
    1.13 +	is_TIF = 0;
    1.14 +
    1.15  	/* Suppress output from libtiff */
    1.16  	prev_handler = TIFFSetErrorHandler(NULL);
    1.17  	
    1.18 @@ -92,13 +97,14 @@
    1.19  	TIFFSetErrorHandler(prev_handler);
    1.20  
    1.21  	/* If it's not a TIFF, then tiff will be NULL. */
    1.22 -	if(!tiff)
    1.23 -		return 0;
    1.24 +	if ( tiff ) {
    1.25 +		is_TIF = 1;
    1.26  
    1.27 -	/* Free up any dynamically allocated memory libtiff uses */
    1.28 -	TIFFClose(tiff);
    1.29 -	
    1.30 -	return 1;
    1.31 +		/* Free up any dynamically allocated memory libtiff uses */
    1.32 +		TIFFClose(tiff);
    1.33 +	}
    1.34 +	SDL_RWseek(src, start, SEEK_SET);
    1.35 +	return(is_TIF);
    1.36  }
    1.37  
    1.38  SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src)