Taille d'image
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
La photo de profil et les photos de couverture sont renvoyées par l'API People sous forme d'URL. Vous pouvez ajouter les paramètres d'URL suivants à une URL d'image pour obtenir la taille d'image souhaitée.
Syntaxe :
|
url= param1-param2...
|
Exemple :
|
https://lh4.googleusercontent.com/JDjSmaNIR-Q4l6d97ig=s100-c
|
Paramètres |
Nom |
Description |
s n |
size |
Définit la hauteur ou la largeur la plus longue sur n pixels |
w n |
largeur |
Définit la largeur de l'image sur n pixels |
h n |
hauteur |
Définit la hauteur de l'image sur n pixels |
c |
recadrage au format carré |
Définit la hauteur et la largeur du recadrage sur la même valeur. |
p |
recadrage intelligent |
|
- 400 pixels (côté le plus long)
- Paramètre:
=s400
- Exemple:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=s400

- Largeur de 400 pixels
- Paramètre:
=w400
- Exemple:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=w400

- Hauteur de 100 pixels et recadrage
- Paramètre:
=h100-c
- Exemple:
https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig=h100-c

Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/29 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/08/29 (UTC)."],[[["\u003cp\u003eThe People API returns profile picture and cover photos as URLs that can be modified to control image size and cropping.\u003c/p\u003e\n"],["\u003cp\u003eYou can append parameters like \u003ccode\u003es\u003c/code\u003e for size, \u003ccode\u003ew\u003c/code\u003e for width, \u003ccode\u003eh\u003c/code\u003e for height, \u003ccode\u003ec\u003c/code\u003e for square crop, and \u003ccode\u003ep\u003c/code\u003e for smart crop to the image URL.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003es\u003c/code\u003e\u003cem\u003en\u003c/em\u003e sets the longer dimension to \u003cem\u003en\u003c/em\u003e pixels, while \u003ccode\u003ew\u003c/code\u003e\u003cem\u003en\u003c/em\u003e and \u003ccode\u003eh\u003c/code\u003e\u003cem\u003en\u003c/em\u003e set specific width and height, respectively.\u003c/p\u003e\n"],["\u003cp\u003eAdding \u003ccode\u003ec\u003c/code\u003e creates a square crop, ensuring both height and width are equal.\u003c/p\u003e\n"]]],["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"],null,["# Image Sizing\n\nThe profile picture and cover photos are returned by the People API as URLs.\nYou can append the following URL parameters to an image URL to get the image size that you want.\n\n|----------|----------------------------------------------------------------|\n| Syntax: | *url* `=`*param1-param2...* |\n| Example: | `https://lh4.googleusercontent.com/JDjSmaNIR-Q4l6d97ig=s100-c` |\n\n| Parameter | Name | Description |\n|-----------|-------------|--------------------------------------------------|\n| `s`*n* | size | Sets the longer of height or width to *n* pixels |\n| `w`*n* | width | Sets width of image to *n* pixels |\n| `h`*n* | height | Sets height of image to *n* pixels |\n| `c` | square crop | Sets height and width of crop to the same value |\n| `p` | smart crop | |\n\n400 pixels in longest side\n: Parameter: `=s400`\n: Example: `https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig`**=s400**\n:\n\n400 pixels wide\n: Parameter: `=w400`\n: Example: `https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig`**=w400**\n:\n\n100 pixels high and cropped\n: Parameter: `=h100-c`\n: Example: `https://lh4.googleusercontent.com/JDjSmaNIR-Px5svzdyVwpGd9B6S8vaCt0sWMxGjpkHOm-u6Q4lmJhVrRwq3oz8MGu3QrfyqjrrDo4CZUtgIa6d97ig`**=h100-c**\n:"]]