-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add ImageFormatSetting::Guess to image loader #13575
Add ImageFormatSetting::Guess to image loader #13575
Conversation
Note: when loading images without extension, a warning gets logged to the console: |
random ci failure, trying to retrigger it |
Oh wow. I don't recall seeing that PR/commit at all 😲 I just wrote this for internal use in my app (as an ugly wrapper around ImageLoader) and then up-streamed it here after some cleanup. I didn't realize there was already another one opened. |
No worries! This change was pretty mechanical: very reasonable that the first step looked extremely similar <3 |
Objective
Solution
ImageFormatSetting
calledGuess
. The loader will useimage::guess_format
to deduce the format based on the content of the file.Testing
sprite
example:Changelog
Added
ImageFormatSetting::Guess
to automatically guess the format of an image asset from its content.