Page 1 of 1
Problem with getimagesize
Posted: Sun Apr 23, 2006 11:33 pm
by Benjamin
This is returning false on valid images. I am using it to test whether an uploaded file is an image or not. What is the deal?
Code: Select all
if (!getimagesize($FILE)) {
// not an image
}
Posted: Sun Apr 23, 2006 11:48 pm
by feyd
you sure $FILE is set correctly?
Posted: Sun Apr 23, 2006 11:55 pm
by Benjamin
Yeah I have a folder full of images, it works on about 1/10th of them. Images are all .jpg as well.
These are uploaded files by the way...
Code: Select all
$_FILES['ImageUpload']['tmp_name']
Posted: Mon Apr 24, 2006 12:14 am
by Benjamin
Well I was using this..
Code: Select all
$Status = $_FILES['Image']['error'];
To test for an error with the file upload, but for some reason it wasn't throwing an error when the image wasn't uploaded due to the MAX_FILE_SIZE directive being set in the html document. Got it fixed now.
Posted: Mon Apr 24, 2006 12:51 am
by feyd
There are multiple types of jpeg files. Some are not encoded to the exact standard, they are considered errant by php. This is fixed in later versions of php if I remember the logs correctly however I can't find the bug right now detailing it.