-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print warning once when loading an image from res://
path
#39396
Conversation
The warning message includes the path, so it's relevant to print it for each affected path, so IMO this change is not a good one. This warning tells you that your tests are doing something wrong, so either your tests should be changed, or this warning is maybe wrong itself. |
I've already initially loaded the images from the imported textures as: var texture = preload("res://rect_rgba.png")
var input = texture.get_data()
# ... and then perhaps `image.duplicate()` to avoid operating on the same image data... instead of: var input = Image.new()
input.load("res://rect_rgba.png") The problem with the former approach is that they must be imported. I run tests with Travis CI command line (
In fact, I've already tried this approach. The first step (1) causes various crashes. Likely due to
Another workaround I've tried is to simply version the So, I wouldn't want to rely on the import process for the "raw" image data to get tested. P.S. I find the warning too verbose. That's something which belongs to documentation IMO. There seems to be no way to control the verbosity of warnings (or the severity of them). The message is more like informational. I think it's enough for users to read this message once, and it's easy to find all the |
Well I've figured a nice workaround to this problem, you just have to explicitly globalize the path: static func image_load_no_warning(filepath):
var image = Image.new()
image.load(ProjectSettings.globalize_path(filepath))
return image Feel free to close this. But it would be nice to:
|
Indeed, you can use |
Slightly offtopic, but I'd love having an --import CLI option, it would allow for better optimized CI/CD scripts when targeting multiple platforms. (See abarichello/godot-ci#11) |
Continuing the import problem, I stumbled upon a limitation/fix in WAT: watplugin/wat@b2fe586. @CodeDarigan do you have anything to add regarding what I've described in #39396 (comment)? |
@Xrayez For a start I don't even think the files get re-imported doing that. They're just ignored but all of the tests work fine doing it. This (image below) from https://godotengine.org/article/core-refactoring-progress-report-2 may solve the issue but it's probably impossible to backport. might solve the problem in future (note it says server is a work around so I might build a docker image and test with that instead). Edit: Seems the Server doesn't recognize the EditorPlugin. |
No clear consensus and I've already found a workaround, so closing. Things to work on:
|
Reopening because I've stumbled upon a previously reported issue which may objectively justify this change now: #24222. |
Alternatively, this warning can be removed, because I've already documented this in #42412, see also #24222 (comment):
The confusion for beginners can be further mitigated by renaming Again, the use cases where this is a valid situation are:
I don't see a way to make this warning more specific to exclude those situations. |
Closing in favor to #42653. |
Closes #24222.
I write unit tests for image processing methods and run them via command line. Unfortunately, the output is polluted with the warning messages for each and every
image.load()
, often "shadowing" any error messages:This PR makes it so that the warning is printed only once during the lifetime of Godot instance.