Add AVIF and HEIF MIME types to Config/Mimes.php - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: Add AVIF and HEIF MIME types to Config/Mimes.php (/showthread.php?tid=88682) |
Add AVIF and HEIF MIME types to Config/Mimes.php - Muzikant - 10-18-2023 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). RE: Add AVIF and HEIF MIME types to Config/Mimes.php - InsiteFX - 10-18-2023 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' => [ RE: Add AVIF and HEIF MIME types to Config/Mimes.php - Muzikant - 10-20-2023 Of course I can. We are in Feature Requests, not in Support category. This is my two cents to improve framework I like. I made a good points these two types should by added generally. RE: Add AVIF and HEIF MIME types to Config/Mimes.php - InsiteFX - 10-20-2023 point taken. Why not make a pr on CodeIgniter GitHub? or Submit an issue if you can not make a pr. RE: Add AVIF and HEIF MIME types to Config/Mimes.php - Muzikant - 10-21-2023 I am not registered on GitHub, because it is owned by Microsoft. RE: Add AVIF and HEIF MIME types to Config/Mimes.php - Moon757 - 10-26-2023 You can add AVIF and HEIF MIME types to Config/Mimes.php by editing the file and adding the corresponding MIME types for these formats. |