CGI-Uploader
    
    
  
  
  
view release on metacpan or search on metacpan
lib/CGI/Uploader/Transform/ImageMagick.pm view on Meta::CPAN
        %p = validate(@_,{
                filename => { type => SCALAR },
                w => { type => SCALAR | UNDEF, regex => qr/^\d*$/, optional => 1, },
                h => { type => SCALAR | UNDEF, regex => qr/^\d*$/, optional => 1 },
            });
        $orig_filename = $p{filename};
    }
    # we have the old ugly style API
    else {
        ($orig_filename, $params) = validate_pos(@_,1,{ type => ARRAYREF });
        # validate handles a hash or hashref transparently
        %p = validate(@$params,{
                w => { type => SCALAR | UNDEF, regex => qr/^\d*$/, optional => 1, },
                h => { type => SCALAR | UNDEF, regex => qr/^\d*$/, optional => 1 },
            });
    }
    die "must supply 'w' or 'h'" unless (defined $p{w} or defined $p{h});
    # Having both Graphics::Magick and Image::Magick loaded at the same time
    # can cause very strange problems, so we take care to avoid that
    # First see if we have already loaded Graphics::Magick or Image::Magick
    
  
  
  
( run in 0.326 second using v1.01-cache-2.11-cpan-a1d94b6210f )