2
2
SDL_image: An example image loading library for use with SDL
3
Copyright (C) 1999-2004 Sam Lantinga
3
Copyright (C) 1997-2006 Sam Lantinga
5
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
6
modify it under the terms of the GNU Lesser General Public
7
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
8
version 2.1 of the License, or (at your option) any later version.
10
10
This library is distributed in the hope that it will be useful,
11
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Library General Public
16
License along with this library; if not, write to the Free
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
/* $Id: IMG_gif.c,v 1.6 2004/01/04 17:33:01 slouken Exp $ */
25
23
/* This is a GIF image file loading framework */
34
32
/* See if an image is contained in a data source */
35
33
int IMG_isGIF(SDL_RWops *src)
39
start = SDL_RWtell(src);
41
if ( SDL_RWread(src, magic, 6, 1) ) {
41
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) {
42
42
if ( (strncmp(magic, "GIF", 3) == 0) &&
43
43
((memcmp(magic + 3, "87a", 3) == 0) ||
44
44
(memcmp(magic + 3, "89a", 3) == 0)) ) {
48
SDL_RWseek(src, start, SEEK_SET);
311
318
case 0xfe: /* Comment Extension */
312
319
str = "Comment Extension";
313
while (GetDataBlock(src, (unsigned char *) buf) != 0);
320
while (GetDataBlock(src, (unsigned char *) buf) != 0)
315
323
case 0xf9: /* Graphic Control Extension */
316
324
str = "Graphic Control Extension";
526
537
** If this is an "uninteresting picture" ignore it.
529
while (LWZReadByte(src, FALSE, c) >= 0);
540
while (LWZReadByte(src, FALSE, c) >= 0)
532
544
image = ImageNewCmap(len, height, cmapSize);