調整圖片大小
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
People API 會傳回個人資料相片和封面相片做為網址。
您可以在圖片網址後方加上以下網址參數,即可取得所需的圖片大小。
語法: |
url= param1-param2...
|
範例: |
https://lh4.googleusercontent.com/JDjSmaNIR-Q4l6d97ig=s100-c
|
參數 |
名稱 |
說明 |
s n |
size |
將高度或寬度設為 n 像素 |
w n |
width |
將圖片寬度設為 n 像素 |
h n |
height |
將圖片高度設為 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

除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間: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"]]