tests/testthat/test-exr-roundtrip.R

test_that("EXR round-trip works", {
  exr_file <- system.file("image", "rstats.exr", package = "picohdr")
  arr      <- read_exr(exr_file)
  
  tmp_file <- tempfile(fileext = ".exr")
  write_exr(arr, tmp_file, pixel_type = 'half')  
  
  arr2 <- read_exr(tmp_file)

  expect_equal(arr, arr2, ignore_attr = TRUE)
})

Try the picohdr package in your browser

Any scripts or data that you put into this service are public.

picohdr documentation built on Oct. 28, 2024, 5:08 p.m.