mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Add Image.load_exr_from_buffer and enable tinyexr by default
This commit is contained in:
parent
b79fe2e020
commit
6145b0ca29
8 changed files with 52 additions and 4 deletions
|
|
@ -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());
|
||||
|
|
|
|||
BIN
tests/data/images/icon.exr
Normal file
BIN
tests/data/images/icon.exr
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue