get( 'upload_extensions' )); if (!in_array($format, $allowable)) { $err = 'This file type is not supported'; return false; } $maxSize = (int) $params->get( 'upload_maxsize', 0 ); if ($maxSize > 0 && (int) $file['size'] > $maxSize) { $err = 'This file is too large to upload'; return false; } return true; } function parseSize($size) { if ($size < 1024) { return $size . ' bytes'; } else { if ($size >= 1024 && $size < 1024 * 1024) { return sprintf('%01.2f', $size / 1024.0) . ' Kb'; } else { return sprintf('%01.2f', $size / (1024.0 * 1024)) . ' Mb'; } } } function imageResize($width, $height, $target) { //takes the larger size of the width and height and applies the //formula accordingly...this is so this script will work //dynamically with any size image if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target /