0
我在OpenCart中使用了調整大小的功能,但它調整了頂部和底部的圖像白色空白。我不確定,但看起來,調整大小功能只是看寬度,然後測量高度。OpenCart沒有正確調整圖像的大小
if (!empty($product_info) && $product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) {
$this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], 100, 100);
} else {
$this->data['thumb'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
}
這是我使用的代碼,沒什麼。圖像的寬度是我如何設置它,在我的情況下100px。寬度設置爲100px - ,但其頂部顯示爲20px,底部爲白色空間顯示爲20px。