Draw: fix some Imlib warnings
Using an iconbox without an image caused a warning from imlib. Signed-off-by: Gregor Best <gbe@ring0.de> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
396ebe5d0b
commit
c8255ca554
|
@ -744,8 +744,14 @@ draw_image(DrawCtx *ctx, int x, int y, int wanted_h, const char *filename)
|
|||
Imlib_Image image;
|
||||
Imlib_Load_Error e = IMLIB_LOAD_ERROR_NONE;
|
||||
|
||||
if(!(image = imlib_load_image_with_error_return(filename, &e)))
|
||||
return warn("cannot load image %s: %s\n", filename, draw_imlib_load_strerror(e));
|
||||
if (!filename) {
|
||||
warn("cannot load image");
|
||||
return;
|
||||
}
|
||||
if(!(image = imlib_load_image_with_error_return(filename, &e))) {
|
||||
warn("cannot load image %s: %s\n", filename, draw_imlib_load_strerror(e));
|
||||
return;
|
||||
}
|
||||
|
||||
imlib_context_set_image(image);
|
||||
h = imlib_image_get_height();
|
||||
|
@ -784,6 +790,9 @@ draw_get_image_size(const char *filename)
|
|||
Imlib_Image image;
|
||||
Imlib_Load_Error e = IMLIB_LOAD_ERROR_NONE;
|
||||
|
||||
if (!filename)
|
||||
return size;
|
||||
|
||||
if((image = imlib_load_image_with_error_return(filename, &e)))
|
||||
{
|
||||
imlib_context_set_image(image);
|
||||
|
|
Loading…
Reference in New Issue