I'm using the PHP exif_imagetype() function, and trying to accept these types of images:
IMAGETYPE_PNG
IMAGETYPE_JPEG
IMAGETYPE_GIF
But there's no IMAGETYPE_JPG imagetype constant, so all .jpg files are not accepted. Is there any solution to this?
I'm using the PHP exif_imagetype() function, and trying to accept these types of images:
IMAGETYPE_PNG
IMAGETYPE_JPEG
IMAGETYPE_GIF
But there's no IMAGETYPE_JPG imagetype constant, so all .jpg files are not accepted. Is there any solution to this?
IMAGETYPE_JPEG works for files with extensions jpg and jpeg :
var_dump(exif_imagetype ( "abc.jpg" ) == IMAGETYPE_JPEG);
var_dump(exif_imagetype ( "abc.jpeg" ) == IMAGETYPE_JPEG);
outputs
bool(true)
bool(true)