调整图片大小
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
People API 会将个人资料照片和封面照片作为网址返回。您可以将以下网址参数附加到图片网址,以获取您想要的图片大小。
语法如下所示:
|
网址= param1-param2...
|
例如:
|
https://lh4.googleusercontent.com/JDjSmaNIR-Q4l6d97ig=s100-c
|
参数 |
名称 |
说明 |
s n |
大小 |
将高度或宽度的长边设置为 n 像素 |
w n |
width |
将图片宽度设置为 n 像素n |
h n |
高度 |
将图片高度设置为 n 像素n |
c |
方形剪裁 |
将剪裁区域的高度和宽度设为相同的值 |
p |
智能剪裁 |
|
- 最长边 400 像素
- 参数:
=s400
- 示例:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=s400

- 宽 400 像素
- 参数:
=w400
- 示例:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=w400

- 高度为 100 像素并剪裁
- 参数:
=h100-c
- 示例:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=h100-c

如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-29。"],[],["Image URLs from the People API can be modified by appending parameters. The syntax is `url=param1-param2...`. Key parameters include: `s` to set the longer side to a pixel value, `w` for width, `h` for height, `c` for square cropping, and `p` for smart cropping. For example, `=s400` sets the longest side to 400 pixels, `=w400` sets width to 400, and `=h100-c` sets the height to 100 and crops it to a square.\n"]]