Skip to content

Commit

Permalink
Fix issues with OpenEXR images with more channels than RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
Latios96 committed May 15, 2024
1 parent 22aa24f commit 00c4a07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/tool/imagehelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 00c4a07

Please sign in to comment.