[Hybrid] Different default image size for hybrid theme?

ajkessel

Joined: 2007-11-12
Posts: 26
Posted: Mon, 2007-11-12 17:27

Is it possible to use something other than the full size image in the hybrid theme? It appears the default configuration is to resize on the browser end, which is slow and uses lots of extra bandwidth with 8 megapixel images. If I want to use, e.g., the 1280x1024 resize as the default image, is there some way to accomplish that?

 
codesmith

Joined: 2009-07-31
Posts: 2
Posted: Fri, 2009-07-31 18:11

I spent a little time looking at this. I believe Hybrid can't easily handle this because it actually builds all the individual image pages within the main album page. So there's no actual photo page to handle the other sizes. I tried adding the "choose your size" code block with no results. So this is how I worked around it to get a smaller default size:

1) While logged in as admin - set up an alternate size in the Edit Album -> Album -> Resized Images area. I set up just one using 640 x 480 for the target size and checked Active. Then save.

2) Edit the theme.inc file for Hybrid - /gallery/themes/hybrid/theme.inc

3) Around line 351 there's a code block:

	    if (!empty($images)) {
		$image = $images[0];

Change the $images[0] (which is the full size) to $images[1] (which is your first "resize image" size that you did in step 1.

4) Save and you should start seeing the smaller images. Note the full sized images is still sent to print shops like Shutterfly.

Note that if you upgrade the changes to theme.inc will be overwritten. There may be a workaround for that by using a separate override directory.

Gallery version = 2.2.3 core 1.2.0.5
(I know I'm replying to an old post but it's still relevant today.)