Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Haarsma <phaseIV@zonnet.nl>2003-01-29 14:29:06 +0300
committerRob Haarsma <phaseIV@zonnet.nl>2003-01-29 14:29:06 +0300
commit10a8183b7e29883a80c2a4b2987716d3be2a069f (patch)
tree993ad31702632fef6ece9416775961694df56e94
parent768603383ef8725b3131e2ed9fa43a75e2926dd2 (diff)
added loading of bmp images. (bmp code was already present in blender)
-rw-r--r--source/blender/imbuf/intern/util.c9
1 files 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);