WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Sponsors Slideshow Widget] proportionately resized Images in sponsors slideshow 1.9.3

[Plugin: Sponsors Slideshow Widget] proportionately resized Images in sponsors slideshow 1.9.3

  • I’ve modified sponsors-slideshow-widget.php to resize images while keeping them proportional to the original dimensions. Replace lines 155-153 with

    list($width, $height) = getimagesize($link->link_image);
                            $xscale = $instance['width']/$width;
                            $yscale = $instance['height']/$height;
                            if (($xscale > 1) && ($yscale > 1)) {
                                $new_width = $width;
                                $new_height = $height;
                            } else if ($xscale > $yscale) {
                                $new_width = round($width * $yscale);
                                $new_height = round($height * $yscale);
                            } else {
                                $new_width = round($width * $xscale);
                                $new_height = round($height * $xscale);
                            }
    						echo '<img src="'.$link->link_image.'" alt="'.$link->link_name.'" height="'.$new_height.'" width="'.$new_width.'" />';
    					} else {
    						echo $link->link_name;
                        }

    http://wordpress.org/extend/plugins/sponsors-slideshow-widget/

  • The topic ‘[Plugin: Sponsors Slideshow Widget] proportionately resized Images in sponsors slideshow 1.9.3’ is closed to new replies.