Skip to content

Commit

Permalink
Merge pull request #31 from Latios96/fix-openexr-images-with-multiple…
Browse files Browse the repository at this point in the history
…-channels

Fix issues with OpenEXR images with more channels than RGB
  • Loading branch information
inversepixel authored May 16, 2024
2 parents 4688ad8 + 00c4a07 commit b665c50
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 b665c50

Please sign in to comment.