[Bf-blender-cvs] [0afdd11] blender-v2.76-release: Fix T46524: Use Alpha (Straight/Premultiply) option missing in 2.76 for DDS files.

Bastien Montagne noreply at git.blender.org
Thu Oct 29 12:07:25 CET 2015


Commit: 0afdd1139b6e0a2a71f6abcbe18b4b4a42e18da1
Author: Bastien Montagne
Date:   Sun Oct 18 11:13:33 2015 +0200
Branches: blender-v2.76-release
https://developer.blender.org/rB0afdd1139b6e0a2a71f6abcbe18b4b4a42e18da1

Fix T46524: Use Alpha (Straight/Premultiply) option missing in 2.76 for DDS files.

All optional image format are not #define'd in submodules like DDS read/write code.
This means values of `eImbTypes` would not always be the same in all contexts, yuck!

This is a regression and should be backported to 'a' release.

===================================================================

M	source/blender/imbuf/IMB_imbuf_types.h

===================================================================

diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index 4de07bf..e9dcf2d 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -67,32 +67,34 @@ typedef struct DDSData {
  */
 
 /* ibuf->ftype flag, main image types */
+/* Warning: Keep explicit value assignements here, this file is included in areas where not all format defines
+ *          are set (e.g. intern/dds only get WITH_DDS, even if TIFF, HDR etc are also defined). See T46524. */
 enum eImbTypes {
-	IMB_FTYPE_PNG = 1,
-	IMB_FTYPE_TGA,
-	IMB_FTYPE_JPG,
-	IMB_FTYPE_BMP,
-	IMB_FTYPE_OPENEXR,
-	IMB_FTYPE_IMAGIC,
+	IMB_FTYPE_PNG       = 1,
+	IMB_FTYPE_TGA       = 2,
+	IMB_FTYPE_JPG       = 3,
+	IMB_FTYPE_BMP       = 4,
+	IMB_FTYPE_OPENEXR   = 5,
+	IMB_FTYPE_IMAGIC    = 6,
 #ifdef WITH_OPENIMAGEIO
-	IMB_FTYPE_PSD,
+	IMB_FTYPE_PSD       = 7,
 #endif
 #ifdef WITH_OPENJPEG
-	IMB_FTYPE_JP2,
+	IMB_FTYPE_JP2       = 8,
 #endif
 #ifdef WITH_HDR
-	IMB_FTYPE_RADHDR,
+	IMB_FTYPE_RADHDR    = 9,
 #endif
 #ifdef WITH_TIFF
-	IMB_FTYPE_TIF,
+	IMB_FTYPE_TIF       = 10,
 #endif
 #ifdef WITH_CINEON
-	IMB_FTYPE_CINEON,
-	IMB_FTYPE_DPX,
+	IMB_FTYPE_CINEON    = 11,
+	IMB_FTYPE_DPX       = 12,
 #endif
 
 #ifdef WITH_DDS
-	IMB_FTYPE_DDS,
+	IMB_FTYPE_DDS       = 13,
 #endif
 };




More information about the Bf-blender-cvs mailing list