From 10a8183b7e29883a80c2a4b2987716d3be2a069f Mon Sep 17 00:00:00 2001 From: Rob Haarsma Date: Wed, 29 Jan 2003 11:29:06 +0000 Subject: added loading of bmp images. (bmp code was already present in blender) --- source/blender/imbuf/intern/util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index af95e0f8324..fc6a36e9729 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -55,13 +55,13 @@ int IMB_ispic(char *name) { struct stat st; - int fp, buf[10]; + int fp, buf[64]; int ofs = 0; if (ib_stat(name,&st) == -1) return(0); if (((st.st_mode) & S_IFMT) == S_IFREG){ if ((fp = open(name,O_BINARY|O_RDONLY)) >= 0){ - if (read(fp,buf,32)==32){ + if (read(fp,buf,64)==64){ close(fp); if (buf[ofs] == CAT) ofs += 3; if (buf[ofs] == FORM){ @@ -83,8 +83,9 @@ int IMB_ispic(char *name) /* if ((BIG_LONG(buf[0]) == 0x10000000) && ((BIG_LONG(buf[1]) & 0xf0ffffff) == 0)) return(TIM); */ } - if (imb_is_a_png(buf)) return(PNG); - if (imb_is_a_targa(buf)) return(TGA); + if (imb_is_a_png(buf)) return(PNG); + if (imb_is_a_targa(buf)) return(TGA); + if (imb_is_a_bmp(buf)) return(BMP); return(FALSE); } close(fp); -- cgit v1.2.3