wp-media / imagify-plugin

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

Fixes #788 Generate next-gen formats on image upload #809

Closed Tabrisrp closed 3 months ago

Tabrisrp commented 3 months ago

Description

This PR updates the AbstractProcess class to correctly generate the appropriate next-gen formats on image upload.

Fixes #788

Technical documentation

We use imagify_nextgen_images_formats() to determine which next-gen formats are currently enabled, and add the corresponding conversions to the array of images to send to the API.

It also fixes the comparison between the non-next-gen size vs next-gen size, to determine if we should keep the next-gen or not, and some of the code evaluating if the current size is next-gen or not.

Type of change

Checklists

Feature validation

Code style

Mai-Saad commented 3 months ago

@Tabrisrp Thanks for the PR. currently, webP images are generated with upload but it's consuming quota. can you please check? Do we need other GH to stop consuming quota for webP?

Tabrisrp commented 3 months ago

The quota consumption is handled on the API side, I believe it has not yet been updated there. It won't require any plugin change.

johngathure commented 3 months ago

@Tabrisrp Thanks for the PR. currently, webP images are generated with upload but it's consuming quota. can you please check? Do we need other GH to stop consuming quota for webP?

Hello Mai, this has already been fixed (on the API side), but has not been released yet, @piotrbak recommended it to be released with 2.2.