def test_exr_meta_all(self): expected = { 'compression': 'PIZ_COMPRESSION', 'pixelAspectRatio': 1.0, 'displayWindow': { 'xMin': 0, 'yMin': 0, 'yMax': 405, 'xMax': 609 }, 'channels': { 'R': { 'reserved': [0, 0, 0], 'pLinear': (0, ), 'pixel_type': (1, ), 'xSampling': (1, ), 'ySampling': (1, ) }, 'B': { 'reserved': [0, 0, 0], 'pLinear': (0, ), 'pixel_type': (1, ), 'xSampling': (1, ), 'ySampling': (1, ) }, 'G': { 'reserved': [0, 0, 0], 'pLinear': (0, ), 'pixel_type': (1, ), 'xSampling': (1, ), 'ySampling': (1, ) } }, 'dataWindow': { 'xMin': 0, 'yMin': 0, 'yMax': 405, 'xMax': 609 }, 'screenWindowCenter': [0.0, 0.0], 'owner': 'Copyright 2006 Industrial Light & Magic', 'screenWindowWidth': 1.0, 'lineOrder': 'INCREASING_Y' } result = parse_metadata.read_exr_header(self.rec709_test_image_path) assert result == expected
def main(): parser = argparse.ArgumentParser() parser.add_argument(type=str, nargs="+", dest="source_paths", help="Path to source exr image") args = parser.parse_args() paths = args.source_paths for path in paths: if not os.path.exists(path): log.error("Source Path was not found on disk: %s", path) continue metadata = parse_metadata.read_exr_header(path) print(pprint.pformat(metadata)) if len(paths) > 1: print("-" * 80)
def test_exr_meta_owner(): metadata = parse_metadata.read_exr_header(REC709_TEST_IMAGE_PATH) assert metadata['owner'] == 'Copyright 2006 Industrial Light & Magic'
def test_exr_meta_pixelAspectRatio(): metadata = parse_metadata.read_exr_header(REC709_TEST_IMAGE_PATH) assert metadata['pixelAspectRatio'] == 1
def test_exr_meta_compression(input_path, expected_compression): metadata = parse_metadata.read_exr_header(input_path) assert metadata['compression'] == expected_compression
def test_exr_meta_lineOrder(input_path, expected_lineorder): metadata = parse_metadata.read_exr_header(input_path) assert metadata['lineOrder'] == expected_lineorder
def test_oserror_thrown_if_file_does_not_exist(): with pytest.raises(OSError): parse_metadata.read_exr_header('pippo.exr')
def test_exr_meta_all(input_path, expected_metadata): result = parse_metadata.read_exr_header(input_path) assert result == expected_metadata
def test_exr_meta_owner(self): metadata = parse_metadata.read_exr_header(self.rec709_test_image_path) assert metadata['owner'] == 'Copyright 2006 Industrial Light & Magic'
def test_exr_meta_pixelAspectRatio(self): metadata = parse_metadata.read_exr_header(self.rec709_test_image_path) assert metadata['pixelAspectRatio'] == 1
def test_exr_meta_compression(self): metadata = parse_metadata.read_exr_header(self.rec709_test_image_path) assert metadata['compression'] == 'PIZ_COMPRESSION'
def test_exr_meta_lineOrder(self): metadata = parse_metadata.read_exr_header(self.rec709_test_image_path) assert metadata['lineOrder'] == 'INCREASING_Y'
def test_oserror_thrown_if_file_does_not_exist(self): exr_path = 'pippo.exr' with pytest.raises(OSError): parse_metadata.read_exr_header(exr_path)