Comments (4)
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.
from gooey.
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:
"C:\Users\Paul\AppData\Roaming\Gooey\https://dummyimage.com/40x40/f00/f00.png"
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.
from gooey.
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
Valid, chrome saves as regular png: https://dummyimage.com/40x40/f0f/f0f.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.
from gooey.
I can put in a PR for this simple change
Please do!
dummyimage.com is serving webp files for some images and png for others
That is annoying...
I don't know if Defold should support webp files
Not at runtime using image.load(). But loading WebP images using an extension is ofc possible.
from gooey.
Related Issues (20)
- Trying to erase none utf8 characters throw errors HOT 4
- Input state machine doesn't include 'released_now' or 'clickable' fields on last frame HOT 13
- Scroll list flick
- Bug: If dynamic list becomes empty, items have invalid data attached HOT 3
- Using character . after numbers will introduces extra characters on mobile HOT 6
- Missing return checkbox instance in set_checked or set_visible HOT 1
- Scrolling wheel speed option
- How can I change the theme ? HOT 2
- No typing input from Android browsers HOT 2
- Missed backspaces on iOS
- Grid component
- .nodes failing on list items in dynamic_list HOT 3
- Input widget's "deselected_now" property always false
- List data HOT 1
- Lists are not updated on list refresh since 10.0.0 HOT 2
- Fix for trailing spaces creates issues
- Dynamic List Refresh Behavior HOT 3
- Radio parameter description missing
- Feature request: UI navigation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gooey.