From 00c4a075e82fc767c3e9d6b324ed74770b8eaab6 Mon Sep 17 00:00:00 2001 From: Jan Honsbrok Date: Wed, 15 May 2024 11:55:29 +0200 Subject: [PATCH] Fix issues with OpenEXR images with more channels than RGB --- cpp/tool/imagehelpers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/tool/imagehelpers.h b/cpp/tool/imagehelpers.h index 3f1e869..197acf2 100644 --- a/cpp/tool/imagehelpers.h +++ b/cpp/tool/imagehelpers.h @@ -179,7 +179,7 @@ namespace ImageHelpers hdrPixels = new float[imgWidth * imgHeight * 3]; // 1 channel images can be loaded into either scalar or vector formats. - if (exrHeader.num_channels == 1) + if (numRecognizedChannels == 1) { for (int y = 0; y < imgHeight; y++) { @@ -196,7 +196,7 @@ namespace ImageHelpers } // 2 channel images can only be loaded into vector2/3/4 formats. - if (exrHeader.num_channels == 2) + if (numRecognizedChannels == 2) { assert(idxR != -1 && idxG != -1); @@ -215,7 +215,7 @@ namespace ImageHelpers } // 3 channel images can only be loaded into vector3/4 formats. - if (exrHeader.num_channels == 3) + if (numRecognizedChannels == 3) { assert(idxR != -1 && idxG != -1 && idxB != -1); @@ -234,7 +234,7 @@ namespace ImageHelpers } // 4 channel images can only be loaded into vector4 formats. - if (exrHeader.num_channels == 4) + if (numRecognizedChannels == 4) { assert(idxR != -1 && idxG != -1 && idxB != -1);