i am trying to add fixed height width image validation in image crud class but not succeded in it. tried below but not worked. image not uploaded but database entry done.
class ImageUploadHandler
{
private function has_error($uploaded_file, $file, $error) {
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
$file_size = filesize($uploaded_file);
list($width, $height, $type, $attr) = getimagesize($uploaded_file);
if($width != 600 || $height != 800){
return 'maxFileSize';
}
} else {
$file_size = $_SERVER['CONTENT_LENGTH'];
}
}