چۈشەندۈرۈش
AVIF Local Support adds modern AVIF image support to WordPress while keeping compatibility with existing JPEG media. Built by a Boston photographer who just wanted their website to look as good as possible.
GitHub Repository: https://github.com/ddegner/avif-local-support
- Local-first: all processing happens on your own server (works great on local environments like Local, MAMP, Docker) — no external calls.
- Image quality first: uses Imagick when available for high-quality resizing (LANCZOS), corrects EXIF orientation, and preserves ICC color profiles and EXIF/XMP/IPTC metadata when possible.
-
Tunable quality and speed: set AVIF quality (0–100) and encoder speed (0–10) to balance fidelity and performance.
-
Wraps existing
<img>tags in<picture>with an AVIF<source>when an.avifversion is present. - Converts JPEG originals and generated sizes to AVIF on upload, or via a daily/background scan.
- Preserves EXIF/XMP/IPTC metadata and ICC color profiles by default (when using ImageMagick/Imagick).
- WordPress-aware resizing logic enabled by default to avoid double-resizing when generating AVIF sizes from originals.
- New encoder controls: choose chroma subsampling (4:2:0, 4:2:2, 4:4:4) and bit depth (8/10/12-bit). Defaults: 4:2:0 and 8-bit.
- Tools include: convert missing AVIFs, upload a test JPEG, and delete all AVIF files in uploads.
How it works
- Front end: Filters common image outputs to add an AVIF
<source>ahead of the original JPEG. Browsers that support AVIF will use it; others fall back to JPEG. - Conversion: Uses Imagick when available (preferred) — with auto-orientation and LANCZOS resizing — or GD with an AVIF encoder. Quality, speed, chroma subsampling, and bit depth are configurable (subsampling/bit depth applied via Imagick when supported).
- Scheduling: Optional daily scan to backfill missing
.aviffiles for existing JPEGs.
Requirements
- PHP 8.0 or later (8.1+ recommended)
- WordPress 6.5 or later
- Imagick PHP extension recommended for best quality and metadata/ICC preservation. GD fallback supported.
Ubuntu/Debian setup (summary)
For local JPEGAVIF conversion you need either Imagick with AVIF-enabled ImageMagick, or GD with AVIF support:
-
Imagick path (recommended)
- PHP extension: imagick
- System libraries: ImageMagick built with HEIF/AVIF support (via libheif)
- Notes: This path enables higher-quality resizing and preserves metadata/ICC profiles
-
GD path (fallback)
- PHP extension: gd built with AVIF support (provides
imageavifon PHP 8.1+) - Notes: Ensure your distro’s PHP GD is compiled with AVIF; some builds omit it
- PHP extension: gd built with AVIF support (provides
-
Helpful extras
- PHP exif extension (for orientation handling in the GD fallback)
- Web server configured to serve
.avifasimage/avif(Apache/Nginx/LiteSpeed)
Official documentation:
– PHP Imagick installation: https://www.php.net/imagick
– PHP GD installation (AVIF details): https://www.php.net/manual/en/image.installation.php
– ImageMagick format support (AVIF/HEIF): https://imagemagick.org/script/formats.php
– Apache MIME configuration: https://httpd.apache.org/docs/current/mod/mod_mime.html
– Nginx MIME configuration: https://nginx.org/en/docs/http/ngx_http_types_module.html
ئېكران كەسمىسى
ئورنىتىش
- Upload the plugin files to the
/wp-content/plugins/avif-local-supportdirectory, or install via the WordPress Plugins screen. - Activate the plugin through the ›Plugins‹ screen in WordPress.
- Go to Settings AVIF Local Support to configure options.
FAQ
-
Does this modify my original JPEGs?
-
No. It creates
.aviffiles alongside your existing JPEG originals and sizes. -
Will this slow down uploads?
-
If “Convert on upload” is enabled, some servers may take longer to process uploads due to AVIF generation. You can disable this and use the scheduled/background conversion instead.
-
Do I need Imagick?
-
Imagick is recommended for the best results and for preserving metadata and color profiles. If Imagick is not available, the plugin falls back to GD where supported.
-
Does it track users or send data externally?
-
No. The plugin does not track users or send data to external services.
باھالاشلار
بۇ قىستۇرمىغا تېخى باھا يېزىلمىدى.
تۆھپىكار ۋە ئىجادكار
«AVIF Local Support» كودى ئوچۇق يۇمشاق دېتال. تۆۋەندىكى كىشىلەر بۇ قىستۇرمىغا تۆھپە قوشقان.
تۆھپىكار«AVIF Local Support» 1 تىلغا تەرجىمە قىلىنغان. تەرجىمانلارنىڭ تۆھپىسى ئۈچۈن رەھمەت.
«AVIF Local Support» نى تىلىڭىزغا تەرجىمە قىلىڭ
ئىجادىيەتكە قىزىقامسىز؟
كودقا كۆز يۈگۈرتۈپ، SVN خەزىنە تەكشۈرۈپ ياكى RSSئارقىلىق ئىجادىيەت خاتىرىسىگە مۇشتەرى بولغىلى بولىدۇ.
ئۆزگىرىش خاتىرىسى
0.1.7
- Bugfix: Correct AdobeRGB desaturation by preserving ICC from a fresh read and only adding nclx when untagged; continue to prefer Imagick so ICC survives.
0.1.6
- Color: Preserve ICC profiles when present; add sRGB nclx only when no ICC.
- Color: Avoid transforming tagged images; transform untagged to sRGB to prevent desaturation.
- Color: Explicitly set AVIF nclx to sRGB/full range when applicable.
- Orientation: Normalize EXIF Orientation to 1 after auto-orienting to prevent double-rotate.
- UI: Status tab warns when GD is the preferred method about lack of color management.
0.1.5
- Tools: Add “Delete all AVIF files” action with security checks.
- Admin: Show “Running…” on convert start and poll progress more frequently.
- Admin: Increase spacing and add non-breaking spaces between radio options.
- Admin: Place “Convert now” under file input in Upload Test.
- Status: Deduplicate counts by real JPEG path to avoid double-counting.
0.1.4
- Defaults: Always preserve metadata (EXIF/XMP/IPTC) and ICC color profiles.
- Defaults: Always avoid double-resizing by using WordPress original/-scaled logic.
- Settings: Remove toggles for metadata/ICC/avoid double-resizing (now defaults).
- Settings: Add chroma subsampling radios (4:2:0, 4:2:2, 4:4:4) and bit depth radios (8/10/12-bit). Defaults: 4:2:0 and 8-bit.
- Security: Continue strict sanitization of new settings with whitelists.
- Docs: Update descriptions to reflect new defaults and controls.
0.1.3
- Cleanup: remove unused admin-post “Convert now” handler; AJAX is the single path.
- Cleanup: simplify deactivation routine to directly clear scheduled hooks.
- Cleanup: remove unused global polling object and helpers in
assets/admin.js. - Internal: no user-facing changes; reduces complexity and maintenance overhead.
0.1.2
- Security: ensure all settings use sanitize_callback and validate/escape inputs consistently
- Admin: sanitize GET/FILES handling for the Tools Upload Test
- Prefix: standardize on
aviflosu_*options/defines andDdegner\\AvifLocalSupportnamespace - Docs: update contributor username to
ddegner
0.1.1
- Improve accessibility and settings labels; better time input handling for scheduled conversions
- More robust DOM handling for wrapping images and avoiding double-wrapping
- UI: clearer Convert Now button text and styling on the settings page
- Minor performance and reliability improvements in scheduling and conversion pipeline
0.1.0
Initial release.



