在 php 中,我使用 php move_uploaded_file 函数将图像上传到数据库。现在,当我从数据库中获取图像时,我正在使用此代码来获取图像
$result = mysql_query("SELECT * FROM "._DB_PREFIX_."storeimages WHERE `city_name`='".$_GET['details']."'");
while($row = mysql_fetch_array($result)){
echo '<div class="store-img">';
echo '<img class="store-image" src="storeimages/images/'.$row['store_image'].'" width="100px" height="100px" >';
echo '</div>';
}
在这里,我很容易得到图像。但是在这里你可以看到我已经使用了width="100px"
和height="100px"
图像大小。这会扰乱图像纵横比。为了解决这个问题,我在 google 上进行了搜索,发现imagemagick是一个不错的选择。但我不知道如何将 imagemagick 与简单的 php 一起使用(我没有使用任何类、方法)以及如何在这里使用 imagemagick ? 任何帮助和建议都将是非常可观的。谢谢