Ignore:
Timestamp:
2010-04-12T14:54:17+12:00 (11 years ago)
Author:
kjdon
Message:

added some code for if identify returns size in mb.

File:
1 edited

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.
Note: See TracChangeset for help on using the changeset viewer.