wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
73 stars 27 forks source link

The filter to enable webP along with AVIF isnot working #822

Closed Mai-Saad closed 8 months ago

Mai-Saad commented 8 months ago

Before submitting an issue please check that you’ve completed the following steps:

Describe the bug When using a filter to generate webp along with avif then we upload image , we will have this warning and webp won't be generated [27-Feb-2024 14:10:58 UTC] PHP Warning: Undefined array key "size" in /home/mai/Local Sites/imagifynginx6/app/public/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php on line 1540 To Reproduce Steps to reproduce the behavior:

  1. Enable AVIF
  2. use a filter to enable webP

    add_filter('imagify_nextgen_images_formats', function($formats){
    $formats['webp'] = 'webp';
    
    return $formats;
    });
  3. upload image (small/big)
  4. check ftp and debug.log => webp not generated and warning in log

Expected behavior No warning and webP generated

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming