Skip to content
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

AVIF images arenot automatically generated for existing images after enabling the option #796

Closed
Mai-Saad opened this issue Feb 2, 2024 · 5 comments · Fixed by #806 or #811
Closed
Assignees
Labels
AVIF Avif branch/feature priority: high Issues which should be resolved as quickly as possible severity: moderate type: bug
Milestone

Comments

@Mai-Saad
Copy link

Mai-Saad commented Feb 2, 2024

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

  • Made sure you’re on the latest version => Avif commit: b396de2
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
When enabling AVIF, it isnot automatically generate AVIF for existing images in the media library

To Reproduce
Steps to reproduce the behavior:

  1. Fresh activation of imagify
  2. Upload a couple of images
  3. Enable create AVIF option and save
  4. Check FTP for images in 2 => AVIF not generated

Expected behavior
AVIF version is generated and quota is affected

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

@Mai-Saad Mai-Saad added type: bug priority: high Issues which should be resolved as quickly as possible severity: moderate AVIF Avif branch/feature labels Feb 2, 2024
@piotrbak piotrbak added this to the 2.2 milestone Feb 5, 2024
@Miraeld
Copy link
Contributor

Miraeld commented Feb 15, 2024

Umm, from my tests, here are some complementary informations:

  • If we have the options Auto-Optimize images on upload but AVIF is disabled, when we upload images it gets optimized on upload, and get this status in the DB (wp_postmeta):
meta_key meta_value
_imagify_status already_optimized

Because of this, when we enable AVIF and save, it gets to this line where we get the unoptimized media_ids. However, as the status says already_optimized it won't return these images IDs.

  • If we disable the options Auto-Optimize images on upload, upload images, and we enable AVIF and save, it will generate .avif files.

So the problems lies in the fact that Auto-Optimize images on upload set the status at already_optimized so images aren't getting picked up by the bulk optimization when we save with AVIF enabled.

@piotrbak
Copy link

@Miraeld Could you check how this button works in the current version? The behaviour should be very similar

@Miraeld Miraeld self-assigned this Feb 15, 2024
@Miraeld
Copy link
Contributor

Miraeld commented Feb 15, 2024

I've compared a bit with develop branch.
From what I am seeing,

  • When Auto-optimized is disabled, and we upload an image, we don't get the status already_optimized in the DB.
    It means we have a problem here with the AVIF branch.

@piotrbak I've tried to check the button, but it is also not working on avif branch, and I was trying to debug it on develop to see how it works, and why we could get an error, but once i clicked it one time it disappeared forever, even when I upload new images which aren't optimized. So not sure yet, I'm trying to figure out the differences between develop and avif on the upload part.

@Mai-Saad
Copy link
Author

If we have single large image in media library then enabled AVIF, the AVIF won't be generated in background (tested local using attached image) @Miraeld can you please check if it's working for this image? (note: bulk notice wasnot displayed in this case)
mountain

@Miraeld
Copy link
Contributor

Miraeld commented Feb 23, 2024

@Mai-Saad , I've created this PR #811 to take care of this last feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AVIF Avif branch/feature priority: high Issues which should be resolved as quickly as possible severity: moderate type: bug
Projects
None yet
4 participants