From c36c64359acc556b66197031d30987094a051033 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Wed, 26 Jun 2013 12:44:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20imageMinCheckSize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UploadHelper.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/UploadHelper.class.php b/UploadHelper.class.php index 3251dd7..e0e2929 100644 --- a/UploadHelper.class.php +++ b/UploadHelper.class.php @@ -41,4 +41,20 @@ abstract class UploadHelper } return false; } + + /** + * @param $size + * @param $file_path + * @return bool + */ + public static function imageCheckMinSize($size, $file_path) + { + $imagesize = getimagesize($file_path); + $size_parts = explode('x', $size); + if ($imagesize[0] >= $size_parts[0] && $imagesize[1] >= $size_parts[1]) { + return true; + } else { + return false; + } + } } \ No newline at end of file