Loads an image from a buffer of encoded PNG or JPEG data, uploads it to the GPU, and caches it under name. If an image is already cached under the same name the cached handle is returned and the buffer is ignored. Returns the resulting Image on success, or nil on decode/upload failure.
Parameters
| name | string | The cache key the image is stored under. Pass the same name to |
| data | buffer | The encoded PNG or JPEG bytes to decode. |
Errors
- LuaError internal error -- VM engine context unavailable.