-
Notifications
You must be signed in to change notification settings - Fork 23
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
Example project missing sprites and runtime errors #79
Comments
Hmm, the idea was to show async loading of images from an external source, but it seems like something with the dummyimage.com service has changed. |
I see. That's a very useful thing to have now that I think about it. I've been digging into this since the magenta and pink shaded images (salmon, pink, and coral) do work consistently while the others consistently do not work. The urls work fine when opened in a browser, even clicking them directly from the debugger watch. I see that it is trying to read and write to a file it is opening in appdata on Windows that is not a valid path:
This may have something to do with it or nothing to do with it. I will see if I can get this working as expected since it is very useful and the examples are useful to new devs for baseline best practices. |
tl;dr: dummyimage.com is serving webp files for some images and png for others, and Defold can't open the webp files. I have fixed the issue with the local image cache on Windows, and it now writes the files to disk as expected. I have not tested on linux or mac, but it should work on those too given the nature of how the filename is transformed now. I can put in a PR for this simple change. The current image_cache.lua module will never be able to write/read these files to disk on Windows. The fix would be relevant if someone tried to used the library as-is with valid external image sources. Let me know if you want to review a PR on it since you may want to go a different direction on the example code given the following: After getting it to read/write the files to disk as expected, it still considered some images invalid. After doing some digging into the Defold source, it appears that the stb_image library that is used for loading images can't load the webp files. It wasn't obvious they were webp files until I saved them directly from the browser. They also cannot be imported into the Defold editor when downloaded (giving the same error of unknown format). The dummyimage.com site is serving compatible pngs for some images. Not valid, chrome saves this as a webp file: https://dummyimage.com/40x40/ff0/ff0.png I don't know if Defold should support webp files or if stb will ever support it (this may answer both questions). This issue should probably be closed since it is just an example that is not working. Someone that really needs this to work should hopefully find this issue and proceed with using working external image sources in their project. Let me know if you want a PR on the Windows file path fix in image_cache.lua. |
Please do!
That is annoying...
Not at runtime using image.load(). But loading WebP images using an extension is ofc possible. |
The example project has missing sprites and runtime errors when viewing the vertical list or horizontal list options:
That external url is referenced in:
Should these colored square images be included in the example.atlas instead of pulled from external source?
The text was updated successfully, but these errors were encountered: