Add AVIF and HEIF MIME types to Config/Mimes.php |
Hi. I am using \CodeIgniter\Files\File\guessExtension() to identify, if a file is an image and this function is also based on MIME types. I realized, an AVIF type is not in the Config\Mimes.php file. This image format is included in Mozilla's common image file types. As it is more and more popular now, what about including it?
AVIF MIME types (Wikipedia / right column): Code: image/avif There is also missing HEIF type, which is commonly used on Apple devices. It is not open format (HEIF patent licensing), but as there are CDR and AI formats, it should not be a problem. This format is also widely used, so what about including it too? HEIF MIME types (Wikipedia / right column): Code: image/heif, image/heif-sequence; Yes, there is an image/avif in HEIF too, but this should be an identifier for AVIF format (Wikipedia is not perfect).
You should be able to add them to app/Config/Mimes.php like so, this is the way we use to do it.
PHP Code: 'heif' => [ What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |