Subject: | SaveFile() error return |
Date: | Sat, 16 Jun 2012 10:05:38 +1000 |
To: | bug-Wx-Perl-Imagick [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
wxImage SaveFile() returns true for success and false for failure, but
in Wx::Perl::Imagick it seems to be the other way around.
nosuch.pl below I expected to print "failure" for attempting to load a
non-existent file, but it prints "success".
#!/usr/bin/perl -w
use strict;
use Wx;
use Wx::Perl::Imagick;
# cf using Wx::Image itself
# my $image = Wx::Image->new (20,10);
my $image = Wx::Perl::Imagick->new (20,10);
my $bool = $image->SaveFile('/no/such/dir/dummy.png');
if ($bool) {
print "success\n";
} else {
print "failure\n";
}
exit 0;