Fix T83586: Cycles failing to load OpenEXR image with EXR RGBAZ channels

Don't refuse to load 5-channel images, instead drop any channels after the 4th
and hope that the first channels represent RGBA.

Differential Revision: https://developer.blender.org/D9820
This commit is contained in:
Valdemar Lindberg 2020-12-11 19:08:45 +01:00 committed by Brecht Van Lommel
parent 97651f428b
commit 93c67b0b8e
Notes: blender-bot 2024-03-22 15:57:27 +01:00
Referenced by issue #83586, Cycles cannot read single part 5 channel RGBAZ EXR files that it produces.
1 changed files with 2 additions and 2 deletions

View File

@ -493,8 +493,8 @@ static bool image_associate_alpha(ImageManager::Image *img)
template<TypeDesc::BASETYPE FileFormat, typename StorageType>
bool ImageManager::file_load_image(Image *img, int texture_limit)
{
/* we only handle certain number of components */
if (!(img->metadata.channels >= 1 && img->metadata.channels <= 4)) {
/* Ignore empty images. */
if (!(img->metadata.channels > 0)) {
return false;
}