Jump to content

Purge All Image Variations including Repeater & Repeater Matrix Fields?


prestoav
 Share

Recommended Posts

As part of site development I somethings need to change crop sizes / settings in the codebase after the client has started to add content. This means I can end up with a lot if image variations having been created (and still being used) but with old settings. A good example might be an image variation that was created using a quality of 50 but now the code is set to 100. A new variation is not created under these situations, only if the variation size is changed.

So, is there a way to purge all variations leaving the original uploaded image so new variations can be created at page runtime?

I have tried the 'PageimageRemoveVariations' module (later v4 version) but that doesn't seem to remove images that are in repeater fields or RepeaterMatrix fields. I'm guessing a solution might have to work at a file level rather than field level?

Any help here would be appreciated!

Link to comment
Share on other sites

8 hours ago, prestoav said:

I have tried the 'PageimageRemoveVariations' module (later v4 version) but that doesn't seem to remove images that are in repeater fields or RepeaterMatrix fields.

Maybe check again because I just tested PageimageRemoveVariations and it removed image variations from repeater pages. 

Link to comment
Share on other sites

8 hours ago, prestoav said:

This means I can end up with a lot if image variations having been created (and still being used) but with old settings. A good example might be an image variation that was created using a quality of 50 but now the code is set to 100. A new variation is not created under these situations, only if the variation size is changed.

That's possibly a browser cache issue, because the variation filename doesn't change when the quality option changes. This problem is the motivation behind this module: https://processwire.com/modules/unique-image-variations/

  • Like 2
Link to comment
Share on other sites

  

On 11/28/2023 at 5:38 PM, prestoav said:

As part of site development I somethings need to change crop sizes / settings in the codebase after the client has started to add content. This means I can end up with a lot if image variations having been created (and still being used) but with old settings. A good example might be an image variation that was created using a quality of 50 but now the code is set to 100. A new variation is not created under these situations, only if the variation size is changed.

So, is there a way to purge all variations leaving the original uploaded image so new variations can be created at page runtime?

I have tried the 'PageimageRemoveVariations' module (later v4 version) but that doesn't seem to remove images that are in repeater fields or RepeaterMatrix fields. I'm guessing a solution might have to work at a file level rather than field level?

Any help here would be appreciated!

 

Creating a custom script using the ProcessWire API is likely your best approach to purge all image variations, including those within repeater and Repeater Matrix fields. It allows you to iterate through pages, find images, and delete variations, ensuring a clean slate for updated settings.

  • Like 1
Link to comment
Share on other sites

On 11/28/2023 at 8:46 PM, Robin S said:

That's possibly a browser cache issue, because the variation filename doesn't change when the quality option changes. This problem is the motivation behind this module: https://processwire.com/modules/unique-image-variations/

Hi Robin, actually this solves the issue nicely going forward. Thank you.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...