Skip to content

Commit

Permalink
Expose DWA compression failures
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Mar 22, 2024
1 parent 5e95d88 commit 9a547c2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/GafferImageTest/ImageReaderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,5 +959,26 @@ def testSerialisation( self ) :
script2.execute( serialisation )
self.assertIsInstance( script2["reader"], GafferImage.ImageReader )

def testDWACompression( self ) :

reader = GafferImage.ImageReader()

stats = GafferImage.ImageStats()
stats["in"].setInput( reader["out"] )
stats["areaSource"].setValue( stats.AreaSource.DataWindow )

for file in [
"dwaHalfWithLayerPrefix.exr",
"dwaFloat.exr"
] :
with self.subTest( file = file ) :

reader["fileName"].setValue( self.imagesPath() / file )
stats["channels"].setValue( reader["out"].channelNames() )

for stat in ( "min", "max", "average" ) :
for c, expected in zip( stats[stat].getValue(), imath.Color4f( 0.3, 0.6, 0.9, 0 ) ) :
self.assertAlmostEqual( c, expected, delta = 0.0001 )

if __name__ == "__main__":
unittest.main()
Binary file added python/GafferImageTest/images/dwaFloat.exr
Binary file not shown.
Binary file not shown.

0 comments on commit 9a547c2

Please sign in to comment.