Reputation: 14990
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?
Upvotes: 0
Views: 1758
Reputation:
There is no difference between .jpeg
and .jpg
files. You do not need to treat them separately.
JPG is an abbreviation for JPEG, originally only used on DOS systems which did not support filename extensions longer than three characters.
Upvotes: 1
Reputation: 4544
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)
Upvotes: 2