Add Image.load_exr_from_buffer and enable tinyexr by default
This commit is contained in:
@ -122,6 +122,20 @@ TEST_CASE("[Image] Saving and loading") {
|
||||
"The BMP image should load successfully.");
|
||||
#endif // MODULE_BMP_ENABLED
|
||||
|
||||
#ifdef MODULE_EXR_ENABLED
|
||||
// Load EXR
|
||||
Ref<Image> image_exr;
|
||||
image_exr.instantiate();
|
||||
Ref<FileAccess> f_exr = FileAccess::open(TestUtils::get_data_path("images/icon.exr"), FileAccess::READ, &err);
|
||||
REQUIRE(f_exr.is_valid());
|
||||
PackedByteArray data_exr;
|
||||
data_exr.resize(f_exr->get_length() + 1);
|
||||
f_exr->get_buffer(data_exr.ptrw(), f_exr->get_length());
|
||||
CHECK_MESSAGE(
|
||||
image_exr->load_exr_from_buffer(data_exr) == OK,
|
||||
"The EXR image should load successfully.");
|
||||
#endif // MODULE_EXR_ENABLED
|
||||
|
||||
#ifdef MODULE_JPG_ENABLED
|
||||
// Load JPG
|
||||
Ref<Image> image_jpg = memnew(Image());
|
||||
|
||||
Reference in New Issue
Block a user