image: load with image

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-12-14 10:27:15 +01:00
parent 4b622523eb
commit f8984fc503
1 changed files with 3 additions and 2 deletions

View File

@ -277,14 +277,15 @@ static int
image_new_from_file(const char *filename) image_new_from_file(const char *filename)
{ {
Imlib_Image imimage; Imlib_Image imimage;
Imlib_Load_Error e = IMLIB_LOAD_ERROR_NONE;
image_t *image; image_t *image;
if(!filename) if(!filename)
return 0; 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; return 0;
} }