Suppress runtime warning about Image loading

Godot Version

Godot 4.4.1 stable

Question

I want to allow users to swap out game files in the export (for modding/customisation), so I am using Image.load_from_file to load images. However, using this method results in this runtime warning:

Loaded resource as image file, this will not work on export: '[path]'. Instead, import the image file as an Image resource and load it normally as a resource.

(Ironically, the warning is also shown when loading files in a debug export)

This works perfectly fine on export if I move all the resources in the same directory as the executable (which is what I want to do) and there are seemingly no drawbacks from doing it this way.

So is there a way to suppress the warning, or is there another function with the same functionality that doesn’t throw the warning?

If it works fine, then you can ignore the warning. Godot issues that automatically when you call Image.load_from_file and afaik it can’t be suppressed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.