請看一看的實況或插件的構造函數:
/**
* Thumbnail constructor
*
* @param int (optional) max width of thumbnail
* @param int (optional) max height of thumbnail
* @param boolean (optional) if true image scales
* @param boolean (optional) if true inflate small images
* @param string (optional) adapter class name
* @param array (optional) adapter options
*/
public function __construct($maxWidth = null,
$maxHeight = null,
$scale = true,
$inflate = true,
$quality = 75,
$adapterClass = null,
$adapterOptions = array()
)
您需要修改這樣例如,您的參數
// so height will be calculated
$thumbnail = new sfThumbnail(80, null, true);
不好意思,但是,我不太明白插件怎麼會猜測他想要100px的高度。它是否會按照原始尺寸計算比例?我該如何強制縮小縮略圖? – Throoze