Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenEXR/IlmImf/ImfHuf.cpp: Fix OS dependent exr binary data for piz. #637

Conversation

arkellr
Copy link
Contributor

@arkellr arkellr commented Jan 9, 2020

Issue: piz compressed binary data was OS dependent e.g. different betw linux
and osx. For example if one did a md5 checksum on the compressed data of an exr with identical image pixel/channel data it would return different checksums on linux and osx for the Piz compressor.

This was due to the fact that the encoding huffman table stored, while having the same entries on linux and osx were sorted differently due to the differing behavior of STL heap sort for encode table entries that were equivalent.

Fix was to simply update the heap compare operator to also handled this equality case.

Updated: OpenEXR/IlmImfTest/testHuf.cpp to test for identical platform/os piz compressed exr file data blocks.

Signed-off-by: Arkell Rasiah arasiah@pixsystem.com

Issue: piz compressed binary data was OS dependent e.g. different betw linux
 and osx. For example if one did a md5 checksum on the compressed data of an exr with identical image pixel/channel data it would return different checksums on linux and osx for the Piz compressor.

This was due to the fact that the encoding huffman table stored, while having the same entries on linux and osx were sorted differently due to the differing behavior of STL heap sort for encode table entries that were equivalent.

Fix was to simply update the heap compare operator to also handled this equality case.

Updated: OpenEXR/IlmImfTest/testHuf.cpp to test for identical platform/os piz compressed exr file data blocks.

Signed-off-by: Arkell Rasiah <arasiah@pixsystem.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 9, 2020

CLA Check
The committers are authorized under a signed CLA.

@cary-ilm cary-ilm added the Needs Discussion To be discussed in the technical steering committee label Jan 16, 2020
OpenEXR/IlmImfTest/testHuf.cpp Outdated Show resolved Hide resolved
…tic data sets.

Updated to run compressVerify() on the fill4() and fill5() data sets which are
deterministic across platforms.
Added a comment to explain how these DEK hash are determined aprior for code
defines.

Signed-off-by: Arkell Rasiah <arasiah@pixsystem.com>
@arkellr arkellr force-pushed the bugfix/arkellr-imfhuf-table-order branch from 9832b4f to adffcc4 Compare January 31, 2020 07:23
@cary-ilm cary-ilm merged commit 88246d9 into AcademySoftwareFoundation:master Feb 5, 2020
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion To be discussed in the technical steering committee v2.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants