Resizing Lightbox thumbnails

Adds a Lightbox slideshow to your products.
Post Reply
Posts: 20
Joined: Mon Nov 16, 2009 3:14 pm

Resizing Lightbox thumbnails

Post by yanni »

Am I right to think that Lightbox does not change the aspect ratio of a particular thumbnail image in relation to the original?
I have found out out that if I change the LightboxIconHeight it automatically adjusts the width to keep the same original aspect ratio.

Is there a way of by-passing this and make sure that the icons are re-sized to the given pixel dimensions without keeping the aspect ratio of the original image ?
I know the icons might look distorted but I would still like to be able to resize to custom size.

Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: Resizing Lightbox thumbnails

Post by norman »

Lightbox does not alter the image width to keep aspect ratio. The width and height of all icons are fixed and It maintains aspect ratio of the existing image. It adds borders around the image (if required) to fit the scaled image into the chosen size. You can choose a border colour other than the built-in one of white.

You want to cripple this carefully written functionality and display distorted images.

The code that does this is in file dpimagesupport.php in your Site folder. Look for function fitandscaleimage. You'll need reasonable PHP skills and some knowledge of the GD graphics library.

Note that:-

1) The dpimagesupport.php library is used by my other add-ons that work with images, so changes you make will affect them too.

2) You need to restart Actinic after making any changes to this file as it's only loaded once per session.
Post Reply