• A valid XenForo Licence validation token will be required to complete signup and purchasing.
    This may retrieve this from the XenForo Customer Area.
  • All XenForo 2.3+ add-ons require at least php 8.0, recommend php 8.2+
    All XenForo 2.2+ add-ons require at least php 7.2, recommend php 8.x
    All XenForo 2.0-2.1 add-ons require at least php 5.6, recommend php 7.x.
    The Standard Library add-on is also required.
    Older php versions are not supported, and add-ons will either refuse to install or fail to function.
  • Automatic discounts are applied for orders above $100 USD (10%) or for early renewals (5%)

Dynamic Avatar Transcoding

Dynamic avatar re-scaling with webp support

Overview Releases (6)

Rebuilds XenForo avatar handling to be more cache friendly, and support multiple extensions (png/jpeg/webp)

XenForo transcodes a user's avatar into multiple images, despite that if behind a CDN or with proper cache headers these files will be accessed rarely.

Incomplete features

saveAsWebp's interaction with GIF (aka animated) avatars is not fully explored, but looks to destroy animation being saved as the original.


config.php options

These options are disabled by default, as they can cause data-loss.

PHP:
// only save the 'o' image, reducing disk usage
$config['avatars']['saveAsSingleImage'] = false;
// Serialize the single image as webp, requires 'saveAsSingleImage' to be set
$config['avatars']['saveAsWebp'] = false;

XenForo 2 routing integration

While webserver rewrite rules are recommended, this add-on supports extending XenForo's routing system to provide zero-configuration support for transcoding avatar images.

Nginx URL rewrite config

Code:
    location ^~ /data/avatar/ {
         rewrite ^/data/avatar/([0-9]+)/([0-9]+)-([a-zA-Z])\.(.*)$ /avatar.php?t=$1&u=$2&s=$3&e=$4 last;
         return 403;
     }

Apache URL rewrite config

Add the rule before the final index.php;
Code:
    RewriteRule ^data/avatar/([0-9]+)/([0-9]+)-([a-zA-Z])\.(.*)$ avatar.php?t=$1&u=$2&s=$3&e=$4 [B,NC,L,QSA]

ie, should look similar to;
Code:
    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo


    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^data/avatar/([a-zA-Z])([0-9]+)/([0-9]+)\.(.*)$ avatar.php?t=$2&s=$1&u=$3&e=$4 [B,NC,L,QSA]
    RewriteRule ^.*$ index.php [NC,L]

Product Information

php 7.4+ php with webp support XenForo 2.2+
Seller
Atelier Aphelion
Release date
Last update
Customer rating
0.00 star(s) 0 ratings

Pricing information

12 Months
$35.00
Renewal cost
$35.00

Share this product

Back
Top