-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: AVIF Supported #8560
feat: AVIF Supported #8560
Conversation
Thank you for sending PR! But you created your PR branch from Can you run |
Also, fix the coding style. If you run 1) system/Images/Handlers/GDHandler.php (unary_operator_spaces, statement_indentation, not_operator_with_successor_space, no_extra_blank_lines, blank_line_before_statement, no_whitespace_in_blank_line)
---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/system/Images/Handlers/GDHandler.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/system/Images/Handlers/GDHandler.php
@@ -274,7 +274,7 @@
throw ImageException::forSaveFailed();
}
break;
-
+
case IMAGETYPE_AVIF:
if (! function_exists('imageavif')) {
throw ImageException::forInvalidImageCreate(lang('Images.avifNotSupported'));
@@ -376,11 +376,11 @@
return imagecreatefromwebp($path);
- case IMAGETYPE_AVIF:
+ case IMAGETYPE_AVIF:
if (! function_exists('imagecreatefromavif')) {
throw ImageException::forInvalidImageCreate(lang('Images.avifNotSupported'));
}
-
+
return imagecreatefromavif($path);
default:
----------- end diff -----------
2) system/Images/Handlers/BaseHandler.php (trailing_comma_in_multiline, unary_operator_spaces, not_operator_with_successor_space, no_extra_blank_lines, blank_line_before_statement)
---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/system/Images/Handlers/BaseHandler.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/system/Images/Handlers/BaseHandler.php
@@ -113,7 +113,7 @@
protected $supportTransparency = [
IMAGETYPE_PNG,
IMAGETYPE_WEBP,
- IMAGETYPE_AVIF
+ IMAGETYPE_AVIF,
];
/**
----------- end diff ----------- |
Thanks for your help, i dont use composer for Github, i push directly from Github Website. |
fix icons to svg and friendly design
oh no i have delete the repo.. do you have possibilitie to re-open ? (i have make other change in toolbar, and my commit is deleted :O) |
I recommend to use local IDE like PhpStorm, VS Code, etc. Also, one branch is needed for one PR. I pushed the branch in my local repository: |
Description
Here is an edition to support the .AVIF format on CodeIgniter 4.5.0, which is the successor to .webp in the years to come. Currently, only three browsers do not yet support AVIF (88.81% of browsers support this version).
https://caniuse.com/avif
The AVIF format is lighter than WEBP.
Here is an example of a comparison from my CodeIgniter CMS, for instance.
Warning, changing the format to a larger one than the original image increases its file size.
Exemple of use:
$image->withFile($pathfolder.$newName)->convert(IMAGETYPE_AVIF)->save($pathfolderLarge.mb_url_title($newNameC).'.avif');
Checklist: