How to regenerate all thumbnails?

Is there any way to regenerate all thumbnails that have been produced for images? We’re thinking of switching to a different thumbnail generator and would like to reprocess the images already in the system. Similarly, we’re contemplating a site refactoring that would require a new thumbnail size.

I don’t know of an easy way to do this.

As you probably know, the thumbnail generator is a “pre-exit” that runs as part of the content editor process. It looks for uploaded binary image files and transforms them into the thumbnail.

To re-execute this process will require you to download and re-upload the images (so that the thumbnail generator will run on the upload). While this can be “simulated” with web services, it’s not a simple process.

Dave

I was afraid that might be the answer. Do you see any problems that might be caused by doing this through an offline process that directly modifies the database content? I’m envisioning something that iterates through rxs_ct_sharedimage, reads the blob stored for img1 as an image, processes it, and stores the resulting bytes in the img2 column, updating img2_size along the way. Obviously, a full publish will need to be done afterwards, since these changes won’t be visible to an incremental publishing edition.

Yes, you can do direct database updates, but it’s slightly more complicated than you think.

There is a row in sharedimage table for each revision of the image, so you really need to look at the CONTENTSTATUS table and make sure that you are using the EDIT or CURRENT revision. You might also want to modify the LASTMODIFIED column in CONTENTSTATUS while you are making the changes.

Make sure that the server is DOWN when you run this (there are some internal caches that might get messed up) and that you backup the database before you start.

As an alternative, you could do this with Web Services, but that will probably be considerably slower than accessing the database directly.

Dave

Thanks for the tips - much appreciated.