[SOLVED] Thumbnails: default thumbnail "area"

titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Fri, 2005-09-30 06:11

I'm using square thumbnails and instead of having it take just a small part of the image as the thumbnail, I'd like to have it take most of the image (just extend out to the edge of the shortest side of the image and create a square crop). I know how I can do this one by one, but the issue is I have 13,000 photos in my G2 install (migrated from G1.4.4) and I can't find a way to do make this sweeping change in one fell swoop. Is there a way to batch process thumbnail area selection?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-09-30 07:39

site admin -> square thumbs -> change setting
yourgalleryurl/lib/support/ -> cache -> delete derivative cache
site admin -> maintainance -> build thumbs / resizes (will take more than an hour)
______________________________________
G2 Embedding & Integration: Download and Development Instructions, G2 FAQ

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Fri, 2005-09-30 22:48

This didn't seem to work...all of my thumbnails came back the same as before. I tried clearing my browser cache as well just to be sure.

The tried to resize the area of a few of them manually and the thumbnails were rebuilt in the same way http://dodoskido.com/gallery/v/2005/album155/ . Is this expected?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-09-30 22:52

do the thumbnails change when you go to an album, click "edit album" and then tick the checkbox "recreate thumbnails" and hit save?

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Sat, 2005-10-01 03:29

Nope, they're still the same.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-10-01 10:34

please create a screenshot from your site admin -> square thumbnails page, i'm not sure you have the correct settings there.

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Sun, 2005-10-02 16:11

Here you go...something wrong?

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Tue, 2005-10-04 23:01

When I added a new set of galleries, it seemed to create the thumbnails properly. I tried (again) to delete the derivative cache and recreate and still no luck. Is there some settings cached somewhere for each file (database perhaps?) that square thumbnails uses that also needs to be flushed for this to work?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-10-05 14:17
Quote:
I know how I can do this one by one

Please describe how.

Quote:
they're still the same

What is "the same"? Perhaps a screenshot of a thumbnail that looks the way you want and one that doesn't.

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Wed, 2005-10-05 17:00

one by one = edit each photo, go into the thumbnail settings, applet loads, resize thumbnail area (see attached files: thumbresizer*.jpg)

Same = after deleting the derivative cache, confirming my square thumbnail settings were for the full image, then rebuilding my thumbnails, the thumbnails came out to be just a small cropped corner of the image rather than the entire image (see thumbresizer-wrong.jpg). I expected them to rebuild with the new square thumbnail settings (see previous post with attachment).

An example of the way it looks now (the "wrong" way): http://dodoskido.com/gallery/v/2005/album147/ (thumbresizer-wrong.jpg shows what it's doing now)

An example of the way adding new images looks now (not 100% what I want, but better than "wrong"): http://dodoskido.com/gallery/v/2005/album_002/ (thumbresizer-currentsetting.jpg -- produces a rectangular thumbnail which defeats the purpose of square thumbnails plugin, but better than "wrong")

An example of the way I'd like to have it look (had to manually resize each thumbnail...very time consuming and not practical for the number of images in my gallery): http://dodoskido.com/gallery/v/2005/album155/ (thumbresizer-perfect.jpg -- it would AWESOME to be able to apply this setting to all images and then have it rebuild all of the thumbnails).

BTW, When I had Gallery 1.4.4, I followed instructions to modify it to do square thumbnails and it basically did the "perfect" scenario...just created square thumbnails with a good portion of the center of the image rather than the upper left corner.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-10-05 18:12

The square thumbnails mod for G1 changes how G1 interprets the crop parameters. When you then import those photos to G2 you end up with crop parameters that produce the "wrong" thumbnails you see. When you use G2's Crop Thumbnail applet you are able to overwrite those bad crop parameters to fix a single thumbnail.

G2's square thumbnail module does not set an actual crop operation in the thumbnail settings; rather it modifies how the "thumbnail" operation is performed, calculating the proper parameters at the time the thumbnail is created. If that thumbnail also has its own crop parameters those will be used as well. So when you clear the derivative cache and rebuild all thumbnails it still uses the bad crop parameters that were migrated from G1.

Solution: backup your database and then manually update the g_derivativeOperations column of g2_Derivative table to remove all those crop parameters from the G1 migration. After this clear your db and derivative cache and rebuild thumbnails.
If every thumbnail in your gallery is the same size this may be as simple as:
UPDATE g2_Derivative SET g_derivativeOperations = 'thumbnail|150' where g_derivativeOperations LIKE '%crop%';
(replace 150 with whatever size..)
If you have multiple sizes then I guess an update for each..
UPDATE g2_Derivative SET g_derivativeOperations = 'thumbnail|175' where g_derivativeOperations LIKE 'crop|%;thumbnail|175';
for each different size..

 
titaniumtommy
titaniumtommy's picture

Joined: 2003-01-21
Posts: 9
Posted: Wed, 2005-10-05 22:13

This seems to have been the issue. I'm rebuilding after modifying the entries in the db. I had to clear the browser cache, but it seems to be working!

Thanks for your help both mindless and valiant. I can't wait to skin my g2 now :)

 
LJ Munz
LJ Munz's picture

Joined: 2005-09-12
Posts: 48
Posted: Tue, 2005-12-20 07:39
mindless wrote:
Solution: backup your database and then manually update the g_derivativeOperations column of g2_Derivative table to remove all those crop parameters from the G1 migration. After this clear your db and derivative cache and rebuild thumbnails.
If every thumbnail in your gallery is the same size this may be as simple as:
UPDATE g2_Derivative SET g_derivativeOperations = 'thumbnail|150' where g_derivativeOperations LIKE '%crop%';
(replace 150 with whatever size..)
If you have multiple sizes then I guess an update for each..
UPDATE g2_Derivative SET g_derivativeOperations = 'thumbnail|175' where g_derivativeOperations LIKE 'crop|%;thumbnail|175';
for each different size..

Although the source of my problem was a little different, these instructions helped a ton!

I was migrating my gallery installation to a new server and after transfer, rebuilt thumbnails from maintenance. Unfortunately I didn't realize the square thumbnail module had not yet been activated on the new installation & basically broke the layout with 10k odd sized thumbs. After searching through the forums for a solution to rebuild my thumbnails from scratch I landed on this post which was exactly what I needed! Thank you :)