image: load with image
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a038f7667c
commit
c4c15dba97
|
@ -280,14 +280,15 @@ static int
|
|||
image_new_from_file(lua_State *L, const char *filename)
|
||||
{
|
||||
Imlib_Image imimage;
|
||||
Imlib_Load_Error e = IMLIB_LOAD_ERROR_NONE;
|
||||
image_t *image;
|
||||
|
||||
if(!filename)
|
||||
return 0;
|
||||
|
||||
if(!(imimage = imlib_load_image(filename)))
|
||||
if(!(imimage = imlib_load_image_with_error_return(filename, &e)))
|
||||
{
|
||||
warn("cannot load image %s", filename);
|
||||
warn("cannot load image %s: %s", filename, image_imlib_load_strerror(e));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue