Add Image.load_exr_from_buffer#101255
Conversation
|
There is a style issue you can fix. See https://docs.godotengine.org/en/stable/contributing/workflow/pr_workflow.html Run: Not sure where the proper directions are for this. |
|
I could provide a screenshot of it working, although there is not much to see. We tested this with the unit test and a scene where we load an EXR file and set it in a TextureRect for display. |
|
Documentation changes required. Try godot --doctool diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 97c4bba..138abe0 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -346,13 +346,6 @@
[b]Note:[/b] This method is only available in engine builds with the BMP module enabled. By default, the BMP module is enabled, but it can be disabled at build-time using the [code]module_bmp_enabled=no[/code] SCons option.
</description>
</method>
- <method name="load_from_file" qualifiers="static">
- <return type="Image" />
- <param index="0" name="path" type="String" />
- <description>
- Creates a new [Image] and loads data from the specified file.
- </description>
- </method>
<method name="load_exr_from_buffer">
<return type="int" enum="Error" />
<param index="0" name="buffer" type="PackedByteArray" />
@@ -361,6 +354,13 @@
Note: The TinyEXR module is disabled in non-editor builds, which means load_exr_from_buffer will return an error in exported builds unless it is explicitly enabled at build-time using [code]tinyexr_always=yes[/code] SCons option.
</description>
</method>
+ <method name="load_from_file" qualifiers="static">
+ <return type="Image" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Creates a new [Image] and loads data from the specified file.
+ </description>
+ </method>
<method name="load_jpg_from_buffer">
<return type="int" enum="Error" />
<param index="0" name="buffer" type="PackedByteArray" /> |
|
Will those commits be squashed on merge? |
|
No, once this is approved you'll need to squash your commits, but it's not necessary now |
This is also implemented by #73003, although it uses the I think we should rename the option in this PR to |
|
What's the size impact on optimized export templates to enable tinyexr at runtime? We need to evaluate the cost to see if we have to bother adding a SCons option and disabling this by default (which means hardly anybody will use it). |
|
The other PR (#73003) measured a size increase of 100KB for export templates. I assume that value did not change drasticly since then. |
|
I encourage enabling tinyexr by default. |
Image.load_exr_from_buffer
|
Should I commit changes to enable tinyexr by default within this PR or create another one? |
279faec to
3f349aa
Compare
|
It's been quite some time... I just rebased my changes to work with version 4.5. |
3f349aa to
e2cdd25
Compare
doc/classes/Image.xml
Outdated
| <return type="int" enum="Error" /> | ||
| <param index="0" name="buffer" type="PackedByteArray" /> | ||
| <description> | ||
| Loads an image from the binary contents of a OpenEXR file. |
There was a problem hiding this comment.
| Loads an image from the binary contents of a OpenEXR file. | |
| Loads an image from the binary contents of an OpenEXR file. |
|
The requested change was implemented. Is there something else missing for this to be merged? |
|
Could you squash your commits? See our pull request guidelines for more information |
|
Rebased and squashed. |
Repiteo
left a comment
There was a problem hiding this comment.
Great job! Sorry to keep you here a bit longer, but AThousandShip's suggestion appears to have been lost in the squash/rebase process. Re-apply that, and this'll be good to go
|
Oops. Good you noticed that. Its fixed now. |
|
Thanks! Congratulations on your first merged contribution! 🎉 |
This closes godotengine/godot-proposals#676.
A
tinyexr_alwaysbuild option was added to enable TinyEXR even in template builds.This PR was created in collaboration with @tpart120.