framework icon indicating copy to clipboard operation
framework copied to clipboard

jpg vs jpeg

Open peter-mdf opened this issue 13 years ago • 2 comments

Ok, I am not sure if this is a bug or that maybe the documentation should be updated.

I added the mimes validation to my validator, just like the documents described:

'image' => 'mimes:jpg,gif,png'

When I uploaded a file with the 'jpg' extension, the validator failed because the file type was not allowed.

So I checked the mime type to be sure it was a JPG image:

peter@PeterMint ~/Desktop $ file --mime-type logo.jpg 
logo.jpg: image/jpeg

It seems that "$value->guessExtension()" returns "jpeg" which made my validation fail. As soon as I added 'jpeg' to the validator, everything was fine.

I believe a 'jpeg' should be treated the same as 'jpg'. Or am I mistaken?

peter-mdf avatar Jan 23 '13 22:01 peter-mdf

It seems that Symfony uses jpeg. Will make note in documentation.

taylorotwell avatar Jan 24 '13 03:01 taylorotwell

I use mime:jpeg and it accepts jpg as well.

arafatx avatar Aug 30 '15 17:08 arafatx