0

我正在制作一个系统,以便我们的客户可以将图像上传到数字标牌数据库。该系统正在按预期工作,除了一个部分,即最近上传的图像的预览,以便他们可以确保它是他们想要的正确图像。它被剪裁在图像高度的 30-40% 之间。如果我上传大约 1000 像素的东西,它将显示大约 400 像素,如果图像更短,它仍然会显示相同的图像百分比。我已经浏览了我所有的 CSS,但我无法弄清楚它为什么会这样做。当我检查页面上的元素时,没有为其设置高度属性,如果我添加它们,它只会添加到图像应该所在的空白区域。我的代码太长了,无法发布,但基本上我把它作为一个blob存储在数据库中,然后它把lastid拉出来并显示它,但它被剪掉了。任何帮助将不胜感激。

4

2 回答 2

1

您很可能尝试上传大于 BLOB(65535 字节)的图像。这是MySQL 文档

此处的最佳做法是将图像存储在文件夹中,并将该图像的路径存储在数据库中。

于 2013-09-27T16:03:50.520 回答
0

it has nothing to do with mysql, Mysql clipping your data wouldnt make the image smaller (dimension wise) - it would destroy a part of the image.

Your problem is in the CSS / html - use Google chrome and right click on the image to see what CSS is applied. It will be in there or a parent element which the image can not be larger than (assuming your something which sets max-width:100% )

You may have an overflow:hidden to make it appear clipped. or just another element overlapping it but with a higher z-index

于 2013-09-27T16:06:58.203 回答