This commit reverses the OpenEXR specific stuff in the OpenEXR commit I
[blender-staging.git] / source / blender / imbuf / intern / writeimage.c
index d6133a1919311abd1a0e2fbd6db950cc8ec87086..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;
@@ -69,8 +65,19 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
 
        /* Put formats that take a filename here */
        if (IS_jpg(ibuf)) {
-               if(imb_savejpeg(ibuf, naam, flags)) return (0);
-               else return (TRUE);
+               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);
@@ -83,40 +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_bmp(ibuf)) {
-                ok = imb_savebmp(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){