Help for this page

Select Code to Download


  1. or download this
    sub getfilesize{
        my @spec=();
    ...
        $height = unpack('s',pack('s',hex($tmp1)));
        ($height) = $height =~ /(\d+)/;
        }
    
  2. or download this
    use Image::Size;
    my ($width, $height) = imgsize($file);
    ($width) = $width =~ /(\d+)/;
    ($height) = $height =~ /(\d+)/;
    
  3. or download this
    sub getfilesize{
        my $file = shift;
    ...
    
    # example of sub call
    my ($width, $height) = getfilesize('/path/to/file.gif');