From 5e8dc9870b33434b474c99c0ded736bd39867d0f Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 18 Jul 2005 07:37:10 +0000 Subject: do not die if loaded file isn't an image (#16829) --- perl-install/standalone/draksplash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index 13dd89b22..71228c7a7 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -154,7 +154,11 @@ sub load_image { $mode = 0; @image_pixbuf = (); } - $image_pixbuf[$mode] = Gtk2::Gdk::Pixbuf->new_from_file($img); + eval { $image_pixbuf[$mode] = Gtk2::Gdk::Pixbuf->new_from_file($img) }; + if ($@) { + $in->ask_warn(N("Error"), N("Unable to load image file %s", $img)); + return; + } $image_pixbuf[$mode] = $image_pixbuf[$mode]->scale_simple($theme{res_w}, $theme{res_h}, 'hyper'); $image_pixbuf[1-$mode] or $image_pixbuf[1-$mode] = $image_pixbuf[$mode]; $image_area->queue_draw; -- cgit v1.2.1