Facebook 如何处理图像大小调整
您好,我正在构建一个类似于 Facebook 的社交网络,我确实需要一些关于如何处理我的网站中的图像的帮助。我想知道像 Facebook 这样的网站如何管理图像大小的调整。一个例子是查看某人的相册。长度和宽度不仅仅是简单地改变。它们以更专业的方式完成,使图像看起来仍然清晰且不拉伸。他们是否为此使用特殊工具?另一个例子是个人资料图片加载到您的消息墙上时。您朋友的个人资料照片会居中并进行相应裁剪,然后调整大小。他们如何去做这件事。任何帮助将不胜感激。
Hello I am building a social network similar to facebook and I really need some help on how to handle the images in my website. I would like to know how sites like facebook manage the resizing of their images. An example would be looking at someones photo album. The length and width are not just simply changed. They are done in a more professional way to make the image still look clear and not stretched. Do they use a special tool for this. Another example would be profile pics when they are loaded to your message wall. Your friends profile pics are centered and cropped accordingly and then re sized. How do they go about doing this. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们与 GD、Imagick 等图像库按比例调整大小。
灰色区域中的表示就是 HTML 和 CSS 的表示。
They resize proportionally with an imaging library like GD, Imagick or others.
The presentation in the gray area is just that, presentation so HTML and CSS.
他们按比例拉伸图像,这样它们看起来就不会出错;如果您将图像变宽 37.5%...您也会使其高 37.5%。
如果我们知道您熟悉哪种语言,我们可能会提出一些建议来帮助解决这个问题。
They stretch the images proportionally so that they don't look wrong; if you make the image 37.5% wider... you also make it 37.5% taller.
If we knew what language you are familiar with, we could probably suggest something to help with this.