Skip to content

Add support for decoding PXR24 compressed Exr images#3124

Open
brianpopow wants to merge 13 commits intomainfrom
bp/decodePxr24
Open

Add support for decoding PXR24 compressed Exr images#3124
brianpopow wants to merge 13 commits intomainfrom
bp/decodePxr24

Conversation

@brianpopow
Copy link
Copy Markdown
Collaborator

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This PR adds support for decoding EXR images with the pxr24 compression.

@brianpopow brianpopow added the formats:exr Any PR or issue related to OpenExr file format label Apr 26, 2026
int left = (int)(compressedBytes - (stream.Position - pos));
return left > 0 ? left : 0;
});
inflateStream.AllocateNewBytes((int)uncompressedBytes, true);
Copy link
Copy Markdown
Member

@JimBobSquarePants JimBobSquarePants Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

inflateStream.AllocateNewBytes((int)compressedBytes, true);

AllocateNewBytes expects the number of compressed bytes available in the current zlib frame; it uses that value to bound reads from the source stream. Passing uncompressedBytes can let the inflater read past the compressed EXR block boundary, so this should use compressedBytes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, it should be compressedBytes, changed with: c1de5b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

formats:exr Any PR or issue related to OpenExr file format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants