Troubles re-creating Derivatives: New images won't get derivatives

jr--

Joined: 2007-12-27
Posts: 3
Posted: Thu, 2007-12-27 12:33

For some time, I have had a problem when uploading new images to my Gallery installation at http://mycvs.org/photos: While the thumbnails were created, the derivatives (480x480 and 1024x1024 or whatever I choose) never got created for these new images. The result was that on the detail page for an image, I got the full-res image instead of the more appropriate smaller derivative.

I tried everything I found about "troubleshooting" derivatives, changed from GD to ImageMagick, deleted all the caches and rebuilt the Derivatives via the Albums, the Maintenance screen ... whatever. The integrity check never reported anything bad about the derivatives. Interestingly, when I had deleted all cache files, the derivatives of older images always rebuilt correctly, but not the new ones.

After quite a few hours fiddling around with that problem, I finally decided to touch the Derivative-tables in MYSQL directly (See [1]) and to entirely rebuild the derivatives from scratch. This solved my problem.

As Andy commented on my blog [1], there would (maybe?) a better solution for that, and that's why I post my problem here again.


Gallery-Version = 2.2.4 Kern 1.2.0.6
PHP-Version = 5.0.4 cgi-fcgi
Webserver = Apache/2.0.52 (CentOS)
Datenbank = mysqlt 4.1.20, lock.system=database
Werkzeuge = ArchiveUpload, ImageMagick, Exif, LinkItemToolkit, Thumbnail
Beschleunigung = full/3600, partial/900
Standard-Motiv = siriux
gettext = Aktiviert
Sprache = de_DE
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11

[1]: http://mycvs.org/archives/2007/12/26/gallery2-how-to-really-recreate-all-thumbnails-and-derivatives/

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32174
Posted: Thu, 2007-12-27 15:05

I don't know the current state of your database since your truncation of the derivative / derivativeimage tables may have left a mess behind.

If the normal "build thumbs / resizes" task fails with errors, you should look into fixing those errors.

If the normal "build thumbs / resizes" task doesn't help (succeeds but doesn't fix derivatives), then you might want to try:
lib/support/index.php -> cache -> delete thumb/resizes cache.

If that still doesn't help, you could edit the database directly but not the way you did before:
set the the broken flag in the derivative table to 1 for all rows. that might help.
if that doesn't help either, set the width / height to null (empty field) too and set the broken flag again to 1.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

Login or register to post comments
jr--

Joined: 2007-12-27
Posts: 3
Posted: Thu, 2007-12-27 20:58
Quote:
If the normal "build thumbs / resizes" task doesn't help (succeeds but doesn't fix derivatives), then you might want to try:
lib/support/index.php -> cache -> delete thumb/resizes cache.

Thanks for the input. I had no errors when rebuilding the thumbs / resizes. The second solution you describe is what I tried (manually): Deleting the "derivatives" and "entity" subfolder in "cache".

Setting the broken flag to "1" might have helped, maybe this is something that could be added to the maintenance scripts, since really rebuilding the derivatives was what I tried to achieve.

Anyway, I might try restoring the tables from a Backup and reporting the succes I have here. :)

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32174
Posted: Thu, 2007-12-27 21:32

the maintenance script (site admin -> maintenance -> build thumbs / resizes) doesn't RE-BUILD thumbs and resizes. it build thumbs and resizes.
what's the difference? it only builds (creates/generates) thumbs/resizes which don't exist yet and it attempts to fix thumbs/resizes which are marked as broken.
it doesn't generate thumbs/resizes again if one already exists that isn't marked as broken.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

Login or register to post comments
jr--

Joined: 2007-12-27
Posts: 3
Posted: Thu, 2007-12-27 22:10

Hi valiant

Thanks for the clarifications and the insights I was missing about the "broken" flag. After restoring a Backup, some Cache Maintenance and a few builds/rebuilds, my resizes are finally the way they should be and my Database is error free.

One question, though: Wouldn't it be nice to have this workaround with setting "g_isBroken" included in some (new) maintenance script for RE-BUILDING the entire set of thumbs & resizes? I did a search and actually couldn't find any hint regarding this flag and it's use, but it really seems useful.

Cheers
jr

Login or register to post comments