Gallery2: How to really recreate all Thumbnails and Derivatives
I have a small, Gallery2 based Image collection on my website. For some time now, I had problems generating scaled versions of the images when uploading new images. Smaller sizes of images with already correct derivatives were generated corrctly, though.
After much fiddling around, reinstalling plugins, deleting caches, upgrading Gallery and more, I finally found the — simple(!) — solution:
DELETE FROM g2_Derivative;
DELETE FROM g2_DerivativeImage;
… then regenerate all the images and you’re set. It took me an evening(!).
Update 27.12.2007: As you can read in the comments of this post and in this thread, there is actually a better way to achieve the same result, all while keeping the database integrity (Something that my approach obviously didn’t ;)). It goes along the following lines:
- Set the
g_isBrokenFlag in the “Derivative”-Table to 1 for all entries:UPDATE g2_Derivative SET g_isBroken = '1'; - Clear the complete thumbnail and resize cache by going to
http://www.example.com/gallery/lib/support/index.php - Rebuild the thumbnails and resizes via the Maintenance in the Site Administration
This fixed the problem I had. Your mileage may vary.
December 27th, 2007 at 0:15
Thanks for sharing your workaround, but I really need to discourage from performing this hack.
You’re introducing database inconsistencies this way since these DB tables are linked to other ones.
I’d be happy to discuss a better workaround in the official Gallery forums.
Cheers, - Andy, Gallery developergo
December 27th, 2007 at 13:20
Hi Andy
Thanks for the comment. I will happily post my question to the Forum — if there’s a better fix, all the better.
jr