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。