From 13f9f74277f3a82940a3fc09abd3d549a662e855 Mon Sep 17 00:00:00 2001 From: Enzo Maserati Date: Sun, 12 Oct 2014 12:51:10 -0300 Subject: [PATCH] Add option to get file size --- src/Intervention/Image/File.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Intervention/Image/File.php b/src/Intervention/Image/File.php index 0431a2e7..b1dd26aa 100644 --- a/src/Intervention/Image/File.php +++ b/src/Intervention/Image/File.php @@ -58,4 +58,21 @@ class File return $this; } + + /** + * Get file size + * + * @return mixed + */ + public function filesize() + { + $path = $this->basePath(); + + if (file_exists($path) && is_file($path)) { + return filesize($path); + } + + return false; + } + }