Changeset 21866

Show
Ignore:
Timestamp:
12.04.2010 14:54:17 (10 years ago)
Author:
kjdon
Message:

added some code for if identify returns size in mb.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ImageConverter.pm

    r21760 r21866  
    449449    } 
    450450    } 
     451    elsif ($result =~ m/^.* ([0-9]+)(\.([0-9]+))?mb?/) { 
     452    $size = 1024 * 1024 * $1; 
     453        if (defined($2)) { 
     454        $size = $size + (1024 * 1024 * $2); 
     455            # Truncate size (it isn't going to be very accurate anyway) 
     456            $size = int($size); 
     457        } 
     458     } 
    451459    elsif ($result =~ m/^.* (([0-9]+)(\.([0-9]+))?e\+([0-9]+))(kb|b)?/) { 
    452460    # Deals with file sizes on Linux of type "3.4e+02kb" where e+02 is 1*10^2.