This commit reverses the OpenEXR specific stuff in the OpenEXR commit I
[blender-staging.git] / source / blender / imbuf / intern / writeimage.c
index 3bd0e8bafc6fd15c502497c352e349ae685bf69e..150ab8aac26c8f69d6c8e41b089b1a9d0d3c726f 100644 (file)
 #include "IMB_hamx.h"
 #include "IMB_amiga.h"
 #include "IMB_png.h"
+#include "IMB_bmp.h"
 
 #include "IMB_iff.h"
 #include "IMB_bitplanes.h"
 #include "IMB_divers.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
 short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
 {
        short ok=TRUE,delpl=FALSE;
@@ -71,6 +67,18 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
        if (IS_jpg(ibuf)) {
                return imb_savejpeg(ibuf, naam, flags);
        }
+       if (IS_png(ibuf)) {
+               return imb_savepng(ibuf,naam,flags);
+       }
+       if (IS_bmp(ibuf)) {
+               return imb_savebmp(ibuf,naam,flags);
+       }
+       if (IS_tga(ibuf)) {
+               return imb_savetarga(ibuf,naam,flags);
+       }
+       if (IS_iris(ibuf)) {
+               return imb_saveiris(ibuf,naam,flags);
+       }
 
        file = open(naam, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
        if (file < 0) return (FALSE);
@@ -82,32 +90,8 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
        }
 
        /* Put formats that take a filehandle here */
-       if (IS_png(ibuf)) {
-               ok = imb_savepng(ibuf,file,flags);
-               if (ok) {
-                       close (file);
-                       return (ok);
-               }
-       }
-
-       if (IS_tga(ibuf)) {
-               ok = imb_savetarga(ibuf,file,flags);
-               if (ok) {
-                       close (file);
-                       return (ok);
-               }
-       }
        
-       if (IS_iris(ibuf)) {
-               ok = imb_saveiris(ibuf,file,flags);
-               if (ok) {
-                       close (file);
-                       return (ok);
-               }
-       }
-       
-       if (ok) ok = imb_start_iff(ibuf,file);
-
+       ok = imb_start_iff(ibuf,file);
        if (IS_amiga(ibuf)){
                IMB_flipy(ibuf);
                if (flags & IB_rect){