Fix T49815: Blender always reverts to RGBA when using Save As Image.
`BKE_imformat_defaults()` was doing some weird black magic based on imbuf's channels, instead of merely copying imbuf's planes here...
This commit is contained in:
parent
cf9a6b416c
commit
a39ab9cfde
Notes:
blender-bot
2024-05-02 21:33:31 +02:00
Referenced by issue #49815, Blender always reverts to RGBA when using Save As Image
|
@ -1580,24 +1580,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
|
|||
}
|
||||
|
||||
/* planes */
|
||||
/* TODO(sergey): Channels doesn't correspond actual planes used for image buffer
|
||||
* For example byte buffer will have 4 channels but it might easily
|
||||
* be BW or RGB image.
|
||||
*
|
||||
* Need to use im_format->planes = imbuf->planes instead?
|
||||
*/
|
||||
switch (imbuf->channels) {
|
||||
case 0:
|
||||
case 4: im_format->planes = R_IMF_PLANES_RGBA;
|
||||
break;
|
||||
case 3: im_format->planes = R_IMF_PLANES_RGB;
|
||||
break;
|
||||
case 1: im_format->planes = R_IMF_PLANES_BW;
|
||||
break;
|
||||
default: im_format->planes = R_IMF_PLANES_RGB;
|
||||
break;
|
||||
}
|
||||
|
||||
im_format->planes = imbuf->planes;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue