Support » Plugin: Lord of the Files: Enhanced Upload Security » Excellent for adding support to new image file formats

  • Kakemphaton


    Excellent plugin. Even if the description doesn’t say it, this plugin allows AVIF file uploads in WordPress in two steps:

    – Add functions.php support for AVIF mime types (in child theme if possible): easy procedure with lots of tutorials available.

    – Install “Lord of the Files”

    Now you can upload AVIF in WordPress Media manager.

    To the authors: Thank you! The plugin description does not mention AVIF or other new image formats. It would be useful to a lot of users!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Blobfolio


    Thanks for the kind words, @johanneseva!

    Just thought I’d chime in since you mentioned the AVIF image format:

    Upcoming changes to both Google Chrome and Firefox — improved standards compliance via libavif — are going to cause a lot of previously-working AVIF images to stop rendering in the browser. (AVIF files have a lot of redundant metadata that many encoders had previously ignored, but now decoding requires (some of) them.)

    If you have AVIF images in use on any of your web sites, I’d recommend installing Google Chrome Beta (v.91) and visiting those pages in that browser to make sure the images still load correctly.

    If you do end up needing to regenerate the assets, and if you’re on Linux (or are used to building Rust software from source on Mac), you can Google “Blobfolio refract” — I don’t want to get scolded for linking directly, haha — and it should return the Github repository for our guided image encoding software Refract, which tackles WebP, AVIF, and JPEG XL conversions.

    AVIFs made with Refract are fully standards compliant and will load A-OK in the upcoming browser releases.

    @johanneseva how did you manage to upload avif files?
    Im not able to do it =( Can you point me on the right direction or the steps to do it?
    Many thanks

    Plugin Author Blobfolio


    Hi @kyllaz,

    LotF only assists with file type recognition (so e.g. WordPress doesn’t get confused and mistakenly block a file); it doesn’t add or subtract from the specific file types a given WordPress site allows to be uploaded.

    To whitelist AVIF files for your site, you need to add them to the allowed list.

    If you are able to write changes to your theme, you can add something like the following to functions.php:

     * Enable AVIF Uploads
     * @param array $mimes Allowed MIME types.
     * @returns array Allowed MIME types.
    function allow_avif_uploads($mimes) {
        $mimes['avif'] = 'image/avif';
        return $mimes;
    add_filter('upload_mimes', 'allow_avif_uploads');

    Thanks for your quick reply @blobfolio
    It’s working great=)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Excellent for adding support to new image file formats’ is closed to new replies.