Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP test for corrupt (but apparently fine) images
- //check if our image is OK
- if ($image && $imageThumb)
- {
- //check if image is a jpeg
- if (exif_imagetype($_FILES[$k]['tmp_name']) == IMAGETYPE_JPEG)
- {
- list($width, $height, $type, $attr) = getimagesize($_FILES[$k]['tmp_name']);
- //echo 1;
- $image = new SimpleImage();
- //echo 2;
- $image->load($_FILES[$k]['tmp_name']);
- //echo 3;
- $imageThumb = new SimpleImage();
- //echo 4;
- //this next line topples my script, but only for that one image - why?:
- $imageThumb->load($_FILES[$k]['tmp_name']);
- //echo '5<br/><br/>-------<br/>';
- //do stuff, save & update db, etc
- }
- }
Add Comment
Please, Sign In to add comment