Jump to content

 

psirus0588

Member Since 24 Mar 2016
Offline Last Active Apr 28 2016 08:14 AM
-----

Posts I've Made

In Topic: Larger Image on Product Details Page

25 April 2016 - 10:45 AM

Would you mind sharing these code changes with us?

 

find in /app/functions/fn.images.php string:

if (fn_get_image_size($detailed[$k]['path'])) {    $data['detailed_id'] = fn_update_image($detailed[$k], !empty($pair_data['detailed_id']) ? $pair_data['detailed_id'] : 0, 'detailed');
}

and replace to this:


if ($size = fn_get_image_size($detailed[$k]['path'])) {
    $resized_w_h = 1600;
 
    if ($size[0] > $resized_w_h || $size[1] > $resized_w_h) {
        $ratio = $size[0]/$size[1]; // width/height
        if( $ratio > 1) {
            $width = $resized_w_h;
            $height = $resized_w_h/$ratio;
        }
        else {
            $width = $resized_w_h*$ratio;
            $height = $resized_w_h;
        }
        $src = imagecreatefromstring(file_get_contents($detailed[$k]['path']));
        $dst = imagecreatetruecolor($width,$height);
        imagecopyresampled($dst,$src,0,0,0,0,$width,$height,$size[0],$size[1]);
        imagedestroy($src);
        imagepng($dst,$detailed[$k]['path'].'_resized', 9); // adjust format as needed
        imagedestroy($dst);
        $detailed[$k]['path'].= '_resized';
    }
    $data['detailed_id'] = fn_update_image($detailed[$k], !empty($pair_data['detailed_id']) ? $pair_data['detailed_id'] : 0, 'detailed');
}

 

set your limit for widht or height to $resized_w_h