X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/3063ecbb7e74c693653fa31ca5974892946d1f64..e1c0692925:/Imager.pm diff --git a/Imager.pm b/Imager.pm index d3caaf4c..52957805 100644 --- a/Imager.pm +++ b/Imager.pm @@ -144,7 +144,7 @@ BEGIN { if ($ex_version < 5.57) { @ISA = qw(Exporter); } - $VERSION = '1.006'; + $VERSION = '1.009'; require XSLoader; XSLoader::load(Imager => $VERSION); } @@ -1042,7 +1042,12 @@ sub make_palette { ++$index; } - return i_img_make_palette($quant, map $_->{IMG}, @images); + my @cols = i_img_make_palette($quant, map $_->{IMG}, @images); + unless (@cols) { + Imager->_set_error(Imager->_error_as_msg); + return; + } + return @cols; } # convert a paletted (or any image) to an 8-bit/channel RGB image @@ -4222,7 +4227,7 @@ sub _set_error { # Default guess for the type of an image from extension -my @simple_types = qw(png tga gif raw ico cur xpm mng jng ilbm pcx psd eps); +my @simple_types = qw(png tga gif raw ico cur xpm mng jng ilbm pcx psd eps webp xwd xpm dng ras); my %ext_types = ( @@ -4257,6 +4262,15 @@ sub def_guess_type { return $type; } +sub add_type_extensions { + my ($class, $type, @exts) = @_; + + for my $ext (@exts) { + exists $ext_types{lc $ext} or $ext_types{lc $ext} = lc $type; + } + 1; +} + sub combines { return @combine_types; } @@ -4736,6 +4750,10 @@ paletted image addtag() - L - add image tags +add_type_extensions() - +L - add extensions for +new image file types. + align_string() - L - draw text aligned on a point