Knowledgebase: Step by Step Guides
WebP support
Posted by Mark [Elevated X Support], Last modified by Mark [Elevated X Support] on 19 May 2022 01:24 AM

Software Requirements:

As of 4.0.6650, the CMS has support for creating WebP thumbnails for the following:

  • Set/Scene thumbnails
  • Category thumbnails
  • Model thumbnails
  • DVD thumbnails
  • Bonus Item thumbnails
  • Cams Feed thumbnails
  • Tour thumbnails (only if using new tour image system as detailed here)

Steps on updating templates are detailed below.

Updating Templates:

Each area that will use WebP will need the following template files updated. New template files can be found here:

PHP Templates:

These files should be replaced:

  • bonus.tpl
  • cams.tpl
  • functions/standard.tpl
  • globals/stddvdimage.tpl
  • globals/stdmodelimage.tpl

Within functions/standard.tpl, the following functions are updated:

  • StdImage
  • StdCatImage
  • StdStoreImage
  • StdStoreCatImage

These functions will need to be updated, or added if not present in this file.

Members Area:

  • js/helper.js
  • js/modernizr.js
  • mime.ini

Tour area:

  • js/helper.js
  • js/modernizr.js
  • mime.ini
  • custom_assets/js/modernizr.js

If Using EX Protect:

  • /elxprotect/mime.ini

Updating mime.ini will allow for browsers to show WebP images inline on the page instead of attempting to download the file when accessing the image directly.

Enabling WebP Support:

To Enable WebP support for members area thumbnails, to to the sprocket in the upper right corner and choose "Thumb Positions"

From there, when you edit an entry, there should be a checkbox on the bottom of the page to enable WebP

For Tours, this feature is only enabled if the system is using the newer thumbnail system. For more information on this, please check this article here:

If this functionality is in place on the tour in question, you can go into the tour itself and edit the tour:

You should see "Create WebP Images" underneath the section for GIF and MP4 support. If you wish to enable WebP, save this value to "Yes" and save the tour.

And that should be it. WebP files will be created when an admin either batches thumbnails, uploads new thumbnails, or recrops an existing thumbnail.

Creating Files:

Once WebP has been enabled in either of the above places, the system will create a WebP file when:

  • Running thumbnail batches that add or replace existing images
  • Uploading new thumbnails
  • Re-cropping existing thumbnails

Note: There is currently no process in place for creating WebP files without replacing your existing JPEG thumbnails.

AVIF support:

Any template updates here will automatically make your templates also have AVIF support in a future release. AVIF support will require a version of ImageMagick with AVIF support built in.

(0 vote(s))
Not helpful

Comments (0)