mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-29 14:53:12 +00:00
Filesize + account section fix
This commit is contained in:
parent
41d98a7d47
commit
eeb79ec53c
2 changed files with 8 additions and 15 deletions
|
@ -195,6 +195,13 @@
|
|||
// Image resolution
|
||||
list($width, $height) = getimagesize($image_path);
|
||||
echo "<p>Image resolution: ".$width."x".$height."</p>";
|
||||
|
||||
function human_filesize($bytes, $decimals = 2) {
|
||||
$sz = 'BKMGTP';
|
||||
$factor = floor((strlen($bytes) - 1) / 3);
|
||||
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
|
||||
}
|
||||
echo "<p>File size: ".human_filesize(filesize($image_path), 2)."</p>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue