Skip to content

Commit

Permalink
v7.0-a7: AVIF in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Zheng committed Sep 10, 2024
1 parent cfbb13e commit e1f2aca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/base.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ class Base extends Root
protected static $_multi_switch_list = array(
self::O_DEBUG => 2,
self::O_OPTM_JS_DEFER => 2,
self::O_IMG_OPTM_WEBP => 2,
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/crawler.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ public function list_crawlers()

// WebP on/off
if (($this->conf(Base::O_GUEST) && $this->conf(Base::O_GUEST_OPTM)) || $this->conf(Base::O_IMG_OPTM_WEBP)) {
$crawler_factors['webp'] = array(1 => 'WebP', 0 => '');
$crawler_factors['webp'] = array(1 => 'WebP/AVIF', 0 => '');
}

// Guest Mode on/off
Expand Down
6 changes: 5 additions & 1 deletion src/img-optm.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,14 @@ private function _send_request($allowance)
'action' => self::CLOUD_ACTION_NEW_REQ,
'list' => \json_encode($list),
'optm_ori' => $this->conf(self::O_IMG_OPTM_ORI) ? 1 : 0,
'optm_webp' => $this->conf(self::O_IMG_OPTM_WEBP) ? 1 : 0,
'optm_lossless' => $this->conf(self::O_IMG_OPTM_LOSSLESS) ? 1 : 0,
'keep_exif' => $this->conf(self::O_IMG_OPTM_EXIF) ? 1 : 0,
);
if ($this->conf(self::O_IMG_OPTM_WEBP) == 2) {
$data['optm_avif'] = 1;
} elseif ($this->conf(self::O_IMG_OPTM_WEBP) == 1) {
$data['optm_webp'] = 1;
}

// Push to Cloud server
$json = Cloud::post(Cloud::SVC_IMG_OPTM, $data);
Expand Down
6 changes: 3 additions & 3 deletions src/lang.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string)
{
$map = array(
'auto_alias_failed_cdn' =>
__('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') .
__('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') .
' ' .
Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true),

'auto_alias_failed_uid' =>
__('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') .
__('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') .
' ' .
__('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') .
' ' .
Expand Down Expand Up @@ -210,7 +210,7 @@ public static function title($id)
self::O_IMG_OPTM_CRON => __('Auto Pull Cron', 'litespeed-cache'),
self::O_IMG_OPTM_ORI => __('Optimize Original Images', 'litespeed-cache'),
self::O_IMG_OPTM_RM_BKUP => __('Remove Original Backups', 'litespeed-cache'),
self::O_IMG_OPTM_WEBP => __('Image WebP Replacement', 'litespeed-cache'),
self::O_IMG_OPTM_WEBP => __('Next-Gen Image Format', 'litespeed-cache'),
self::O_IMG_OPTM_LOSSLESS => __('Optimize Losslessly', 'litespeed-cache'),
self::O_IMG_OPTM_EXIF => __('Preserve EXIF/XMP data', 'litespeed-cache'),
self::O_IMG_OPTM_WEBP_ATTR => __('WebP Attribute To Replace', 'litespeed-cache'),
Expand Down

0 comments on commit e1f2aca

Please sign in to comment.