Page 1 of 1

Cataloger Item Image on Category Page

Posted: Thu Sep 12, 2013 10:13 am
by delve2013
I want to be able to control the height of the item image shown on the category page. By default you can only control the width and not the height. Anyone know how I can fix this? I'm assuming I would need to edit the cataloger.Image.php file but I'm not sure what to change.

I think it has something to do with this section of code:

Code: Select all

function imageTransform($srcSpec, $destSpec, $size, &$config, $aspect_ratio='')
    {
        require_once(dirname(__FILE__).'/../../lib/filemanager/ImageManager/Classes/Transform.php');

        $it = new Image_Transform;
        $img = $it->factory($config['image_manipulation_prog']);
        $img->load($srcSpec);
        if ($img->img_x < $img->img_y)
            {
            $long_axis = $img->img_y;
            }
        else
            {
            $long_axis = $img->img_x;
            }

        if ($long_axis > $size)
            {
            $img->scaleByLength($size);
            $img->save($destSpec, 'jpeg');
            }
        else
            {
            $img->save($destSpec, 'jpeg');
            }
        $img->free();
    }
The alternative would be to use CGSmart Image but I'm getting the following error when trying to use it:

Code: Select all

Could not find a file at: http://176.32.230.29/intricatecreations.co.uk/modules/Cataloger/Cataloger.Image.php?i=cascading-flowers_s_1_220_1.jpg&ac=83613

Re: Cataloger Item Image on Category Page

Posted: Fri Sep 20, 2013 12:44 pm
by Tetsuo
I would suggest that you set the width value in the Cataloger settings (as you mention) so that it proportionally creates the desired height value of the image. Try opening an image file in Photoshop (or similar) and resize it with proportions constrained to see what I mean and find the required width value.

Otherwise you could use CSS to force the height to a particular value?