From 207ec36649fe5d46adb02833ffba703da5b86df9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 29 Jul 2004 10:57:49 +0000 Subject: (show_prev) do not crash when the image format is unknown --- perl-install/standalone/draksplash | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone/draksplash') diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index a9e990c5f..f6bada3d8 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -4,7 +4,7 @@ use strict; use lib qw(/usr/lib/libDrakX); use standalone; use common; -use ugtk2 qw(:helpers :wrappers :create); +use ugtk2 qw(:create :dialogs :helpers :wrappers); use interactive; #- convenience variables for true and false @@ -513,7 +513,16 @@ sub show_prev { $prev_window->set_title( #-PO: First %s is theme name, second %s (in parenthesis) is resolution N("%s BootSplash (%s) preview", $theme{name}, $theme{res}{res})); - $prev_pic = gtkcreate_pixbuf($img_file); + eval { $prev_pic = gtkcreate_pixbuf($img_file) }; + if (my $err = $@) { + err_dialog(N("Error"), + #-PO: Do not alter the and tags + N("The image \"%s\" cannot be load due to the following issue:\n\n%s", $img_file, $err), + { use_markup => 1 } + ); + return; + } + $prev_pic->scale_simple($theme{res}{w}, $theme{res}{h}, 'hyper'); $prev_canvas && $prev_canvas->isa('Gtk2::Widget') or $prev_canvas = Gtk2::DrawingArea->new and $prev_window->add($prev_canvas); -- cgit v1.2.1