Plugins: AVIF Image Support
AVIF on PHP Server
Ako želiš da kreiraš AVIF odnosno da konvertuješ u i iz AVIF formata, na serveru je neophodno da imaš ili GD Library ili ImageMagick PHP module, kao PHP: Image Processing and Generation - Manual
GD library is mostly installed by default but it doesn’t support AVIF manipulation in PHP 7.4
apt install php{7.4,8.1,8.2}-gd
if you want AVIF manipulation, this is suggested as it even works for PHP 7.4
apt install php{7.4,8.1,8.2}-imagick
There is PHP support now to confirm with phpinfo()
or php -i | grep AVIF
.
GD: AVIF image support - PHP 8.1 • PHP.Watch
If you need a fast library, the fastest one is libvips, which also supports SVG, WebP, and AVIF. For PHP integration, you can refer to the php-vips repository on GitHub.
|
|
Želim da fiksiram da se samo php8.3 instalira iz ondrej repository:
|
|
Kad sam već počeo, hajdemo i na HTTP/3:
|
|
ali to neće da može jer CloudPanel verzija koristi pagespeed i ima i te direktive.
AVIF Image File Format
Focus on WebP as AVIF is mostly NOT supported on mobile
It is available in PHP 8.X
How to Use AVIF: The New Next-Gen Image Compression Format — Lightspeed
AVIF has landed - JakeArchibald.com
Modern Images WP | adamsilverstein/wordpress-modern-images to set default image format used for sub-sized images generated by WordPress. On ne radi ništa posebno, već samo dodaje MIME tipove (hook: mime_types) i samo poziva hook: “image_editor_output_format” čime definiše format na output. I vezano za konverziju, on to ne radi i uopšte ne proverava da li će konverzija biti uspešna niti menja output tagove već obezbećuje da su pravilni tagovi u HTML-u. Sama konverzija se radi standardnim PHP toolovima (GD, ali ne i sa ImageMagick itd). Čak je i AVIF podržan u novom PHP-u.
Avif Express sa repo na Pijushgupta/avif-express: Wordpress plugin to convert jpg,png and webp to avif and render them se bavi i konverzijom i serving ali serving samo tako što menja images na proper format. Moraš da instaliraš direktno sa GitHub preko https://codeload.github.com/Pijushgupta/avif-express/zip/refs/heads/main
URL. Poseduje najosnovniku bulk konverziju a za sve konverzije koristi Imagick a kao backup GD Library dok opcija Cloud nije stvarno definisana nego neki custom developed. Radi, ali ustvari slike generiše on-the-fly (ali ima i opciju “Disable on the fly avif conversion”), i menja u IMG tagu sve na avif, ali ne generiše
AVIF Support | AVIF Uploader ume da konvertuje sve u AVIF ako imaš podršku na serveru, a pregledao sam i vrlo je ok kodirano. Ne bavi se servovanjem niti išta slično, ali prilikom upload-a kreira AVIF, a pruža i podešavanje kvaliteta konverzije. Tu se nalazi i onaj “server check” koji proverava AVIF capabilities. Dakle, ovo je za kreiranje prilikom upload.
The plugin Imghaste is fascinating for its implementation of modern image formats, including AVIF and WebP. To ensure compatibility with caching plugins, plugin utilizes a Service Worker to intercept and serve images that are supported by the client. This allows for seamless integration with images in CSS files and those requested via Ajax. Overall, Imghaste is a highly intriguing plugin that warrants further analysis.
Maximally optimizing image loading for the web
Ideal and proper AVIF and WebP encoding quality settings i testiranje AVIF and WebP image quality settings
WebP & AVIF Converter je plugin sa repo na korneliuszburian/webp-avif-converter, koga sam slučajno pronašao tako što lik kompletno objavio kod za plugin - php - WordPress Plugin for WebP/AVIF Image Conversion - Code Review Stack Exchange, ali samo za konverziju formata prilikom upload-a. Nema skoro nikakve opcije, ali je uspešno uradio kreiranje oba formata prilikom upload-a.
The WebP Converter for Media also supports AVIF in the Pro version, which can be found on GPL sites. To activate the Pro version in the GPL version, you can use any string as an access token. It uses either the GD library or Imagick for conversion and can perform server HTML rewriting for serving proper image by utilizing an interesting “PassThru” mode that creates webpc-passthru.php
with the use of ob_start
. Images are saved in a separate directory /uploads/uploads-webpc
, and that’s also configurable. Additionally, it supports AVIF, but only in the Pro version and it adds a useful option for regenerating thumbnails in the Media Library. The issue I’ve had is that it didn’t work with the AVIF format - it reported as “crashed”, while everything else worked very well. Useful snippet Nginx configuration for the WebP Converter for Media WordPress plugin - Useful Snippets.
The Squidge plugin on the ainsleyclark/squidge repository is insteresting as it’s supports AVIF and can also utilize local tools via shell. It can generate <picture>
tags using the squidge_image
helper function and can be set up with either nginx or apache rules. However, it seems that the plugin is no longer actively developed. It also offers a WP-CLI command to regenerate everything at once. Nema mnogo korisnika pa mislim da je prestao da troši vreme na to.
Image Type Converter je od iste firme koja pravi “AVIF Support” plugin, a omogućava konverziju slika, bez načina serve-ovanja, tako što imaš link pored slike (pun reklama) a tek u Pro verziji može da radi na upload kao i bulk.
You can add the MIME type for AVIF like this, as seen in plugin “WR Allow Modern Images”:
|
|