图像在通过 html 或 css 代码调整大小之前是否已完全下载?
基本上就是问题所问的内容。网站上的图像在调整大小之前是否下载完整文件。我有一堆图片,我使用 html 将图像大小调整为缩略图,以便轻松显示在页面上。然而,这些图像的大小只有 100 像素 x 100 像素,但加载时间很长。我唯一的解释是它在调整大小之前下载整个文件。
Basically exactly what the question asks. Do images on a website download the full file before re sizing them. I have a bunch of pictures and I use html to resize the images down to thumbnails to easily display on the page. However, these images take way to long to load while they are only 100px x 100px big. My only explanation is that it is downloading the entire file before re sizing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。完整图像已下载。
如果源 URL 为 1000x1000,并且您将其在屏幕上的大小调整为 100x100,它仍然需要加载整个图像。
您应该将缩略图存储为 100x100,将完整尺寸存储为 1000x1000,并在适当的时候引用每个尺寸。
Yes. The full image is downloaded.
If the source url is 1000x1000 and you size it on the screen to 100x100, it still has to load the entire image.
You should store the thumbnail at 100x100 and the full size at 1000x1000 and reference each when appropriate.