Search code examples
phpimagejpegmime-typesgetimagesize

Different "jpeg" extensions and php's getimagesize()


So, some img has .jpg extension, some .jpeg, some .JPG and also some .JPEG.

Question: for php function getimagesize(), these 4 extensions is same and will always return image/jpeg as mime type ?


Solution

  • The mimetype of a file is something different then the extension of the file. The mimetype is usually determined by reading the (partial) contents of a file.