Album links use full-sized image causing slow page loads

tgschaef

Joined: 2005-11-04
Posts: 5
Posted: Thu, 2007-12-20 04:08

Wordpress 2.3.1
Gallery 2.2.3
WPG2 3.0.2

All installed just a few days ago on Hostgator.com. First off all three programs are great. Thanks!

Simple observation is that album links use the full size image as its source causing slow page loads since each post is about a photo album with a link to it and full sized images are 5 or 7MP. How do I get it to use reduced size images? A more detailed explanation follows for the curious...

I would like to have album links in my posts to be thumbnails outlined with the spiral notebook frame and images have no frame and use lightbox with the reduced image size when clicked. I currently have that working by selecting spiral notebook for album image in 'WPG2 Tags' and have 'enable lightbox' and 'WPG2 Tags have Lightbox Support?' both set to 'yes'. I insert album links with 'Insert a WPG2 tag for the current album: xxxx' and insert photos as 'WPG2 tag of image'.

The problem is that the album links appear to be using the full sized image for the img src scaled down in the img tag with 'width="150" height="113"'. Image links are fine apparently using the smallest available image. Album links pull down the full sized image and this bogs down the page load since most posts have a link to the album of photos that the post is about. Did I set something up wrong or can I get the same net result in a different fashion? When I insert the image using the option of 'insert thumbnail as link to parent album' it is fine but how would I get the special frame around just that link since it appears to fall under the 'WPG2 Tag Item Frame:' and not 'WPG2 Tag Album Frame:'

Thanks!

Tim

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2007-12-20 22:45

The size of the album link depends on the resized size of your images, if you do not have resized images then Gallery2 will instead load the full sized, or if you are using lightbox and you have the lightbox size setting larger than the resized image then again Gallery2 will load the full sized image..

I tend to set my resized image around 640*480 and set my lightbox size to 300, it works a charm for me..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
tgschaef

Joined: 2005-11-04
Posts: 5
Posted: Fri, 2007-12-21 19:57

I have gallery set up for resizes of 640, 800, and 1024, plus keep the original. It works as you say for the the image links, but the album links use the full size, as verified by right clicking and selecting 'view image' in Firefox. Even in a single post with an album link and the highlighted image as an image link, the image link uses the thumb for the embedded, and the smallest resize for the lightbox, but the album link uses the full size for the album link thumb.

Edit: Scratch that, it's now working as you say. I have 100px thumbs on gallery but I still had 150px as the default thumb on WPG2. If I forgot to tell image links to use 100px thumbs when inserting they just jumped to using the 640px. Apparently since the album link realized that the gallery thumb was 100px and the default WPG2 thumb was 150px it jumped up to using the full-size instead of the next resize up. Hrmph. Fixed once I changed WPG2's default thumb to match Gallery's. Thanks guys!

 
troutbum

Joined: 2008-06-14
Posts: 5
Posted: Sat, 2008-06-14 21:43

Hi tgschaef and ozgreg

Loving the integration between wordpress and gallery2 with wpg2 - powerful, useful and great!

I have just found this thread with the problem of wpg2 using full sized images for album links though I am sure it isn't supposed to. I too am having the exact same problem trying to do the exact some thing as tgschaef which is how I found this thread.

It seems like a bug as it is obviously not meant to work this way. Did you find a resolution? I have posted the same thing on a similar thread. And yes mine works fine inserting just an image rather than an album - even the same image that the album uses - i.e. takes the smaller image.

My smaller images definitley exist for items in my ablums i.e. to re-emphasise I can manually choose the same image as the album would choose and use the spiral notebook on the image rather than the album to get the look I want but then it links to the gallery image rather than the album. I am sure inserting an album isn't meant to work this way.

I think this is a bug! Can someone please verify ifit is a bug and if so should I try to find and fix (with very limited knowledge) or leave to professionals? Or have I just done something wrong - i.e. another setting to tampered with somewhere?

My purpose is much the same as tgschaef. I am a fishing guide and run a blog/fishing report. I do daily reports with a client photo in the blog and also add the daily photos into gallery so clients can download the full size image. I have thumbnail size, full size, and have experimented with a few sizes inbetween like 200 and 400 currently for all images. Setting the desired size inside the <wpg2> tags to |200 or in the other place you can set the default doesn't work if I insert the album instead of an image, i.e. takes the full size image as above. I want to make things as simple as possible for my clients i.e. they should be able to click on the spiral notebook with a photo on it and have it take them through to a screen showing all of the days photos not just one of them and haveing to know how to step up a level in the gallery. Most of them arn't very computer literate. Again the same as tgschaef if I do it the proper way an insert the album it is way to slow as a lot of photos a shot at 10M pixels.

Any advice/info much appreciated.

Cheers
Andrew

 
troutbum

Joined: 2008-06-14
Posts: 5
Posted: Mon, 2008-06-16 23:45

No sure if I have broken anything else but a fix for the above problem within the gallery2/modules/imageblock/classes/ImageBlockHelper.class file:

/* Get the list of resizes */
list ($ret, $resizes) =
// GalleryCoreApi::fetchResizesByItemIds(array($item->getId()));
GalleryCoreApi::fetchResizesByItemIds(array($image->getId()));

This makes it all work properly - not sure if it is meant to be like this and just a typo/bug - also may discover that I have broken something else but seems alright at the moment and now wpg2 is choosing the correct smaller res image for the album as I am sure it is supposed to.

Please reply someone and let me know if this is correct.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sun, 2008-06-22 05:50

I can confirm The album incorrect sized image selection is a bug in Gallery2 2.2 as I raised a bug ticket on this a while ago. The bug has been corrected in Gallery2 2.3.

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo