A function that does a simple JPEG image validation
<? function validate_image(&$img) { if ($img['type'] != 'image/jpeg') return false; if (@exif_imagetype($img['tmp_name']) != IMAGETYPE_JPEG) return false; return true; } ?>
Pass as argument the $_FILES array for one image: $_FILES['img']
Comments
Add your comment