2016-06-17 13 views
1

CPANモジュールを更新した後、このコードを実行しても機能しなくなり、 "コンストラクタへの引数の数が不均一"になります。Perl Image :: Imlib2 :: Thumbnail :: Scaledコンストラクタへの引数の数が不一致

use Image::Imlib2::Thumbnail::Scaled; 
my $thumbnail= Image::Imlib2::Thumbnail::Scaled->new({ 
    sizes => [ 
    { width => 300, height => 300, name => 'large' }, 
    { width => 240, height => 240, name => 'medium' }, 
    { width => 150, height => 150, name => 'small' }, 
    ] 
}); 

答えて

1

イメージの最新バージョン::のImlib2 ::サムネイル::スケーリング(0.05)ハッシュを受け入れるバージョン0.01/0.02/0.03/0.04からコンストラクタを変更し、現在ハッシュリファレンスに失敗したので、以前のコードニーズ更新されるか、失敗します。 http://search.cpan.org/~srchulo/Image-Imlib2-Thumbnail-Scaled-0.05/lib/Image/Imlib2/Thumbnail/Scaled.pm

ドキュメント0.04版: http://search.cpan.org/~srchulo/Image-Imlib2-Thumbnail-Scaled-0.04/lib/Image/Imlib2/Thumbnail/Scaled.pm

は私の問題を解決するには:

ドキュメント0.05 Verは

my $thumbnail= Image::Imlib2::Thumbnail::Scaled->new(
    sizes => [ 
    { width => 300, height => 300, name => 'large' }, 
    { width => 240, height => 240, name => 'medium' }, 
    { width => 150, height => 150, name => 'small' }, 
    ] 
); 

(削除:

my $thumbnail= Image::Imlib2::Thumbnail::Scaled->new({ 
    sizes => [ 
    { width => 300, height => 300, name => 'large' }, 
    { width => 240, height => 240, name => 'medium' }, 
    { width => 150, height => 150, name => 'small' }, 
    ] 
}); 

に変更{と})

関連する問題