Commit: ef3d76fbaa37110fd857f3aabff815600e43915a Author: Ethan-Hall Date: Wed Mar 9 14:53:01 2022 +0100 Branches: master https://developer.blender.org/rBef3d76fbaa37110fd857f3aabff815600e43915a
Fix wrong detection of alpha for grayscale images, after recent changes Differential Revision: https://developer.blender.org/D14286 =================================================================== M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/intern/image.c =================================================================== diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index b3001ecc880..a5a2d57f9d3 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -371,7 +371,7 @@ void BKE_image_merge(struct Main *bmain, struct Image *dest, struct Image *sourc bool BKE_image_scale(struct Image *image, int width, int height); /** - * Check if texture has alpha (depth=32). + * Check if texture has alpha (planes == 32 || planes == 16). */ bool BKE_image_has_alpha(struct Image *image); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 8a212ed0d7d..e01f8cb76c8 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -5853,17 +5853,14 @@ void BKE_image_user_file_path_ex(ImageUser *iuser, Image *ima, char *filepath, b BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id)); } -bool BKE_image_has_alpha(struct Image *image) +bool BKE_image_has_alpha(Image *image) { - ImBuf *ibuf; void *lock; - int planes; - - ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); - planes = (ibuf ? ibuf->planes : 0); + ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); + const int planes = (ibuf ? ibuf->planes : 0); BKE_image_release_ibuf(image, ibuf, lock); - if (planes == 32) { + if (planes == 32 || planes == 16) { return true; } _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
