MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_image_decoder_crafted_tiny_files

Function test_image_decoder_crafted_tiny_files

dali/test/python/decoder/test_image.py:494–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

492
493
494def test_image_decoder_crafted_tiny_files():
495 with tempfile.TemporaryDirectory() as tmpdir:
496 tiny_file_path = os.path.join(tmpdir, "tiny.img")
497 with open(tiny_file_path, "wb") as f:
498 f.write(b"\xff")
499
500 @pipeline_def(batch_size=2, device_id=0, num_threads=1)
501 def pipe():
502 encoded, _ = fn.readers.file(files=[tiny_file_path])
503 decoded = fn.decoders.image(encoded, device="cpu", output_type=types.RGB)
504 return decoded
505
506 p = pipe()
507 assert_raises(RuntimeError, p.run)
508
509
510# Regression test for the nvImageCodec ROI/orientation contract bug. For EXIF

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
pipeFunction · 0.70

Tested by

no test coverage detected