diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 9d483bf2b7..939b5ef96f 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -145,8 +145,8 @@ App::get('/v1/avatars/image') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') - ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true) - ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true) + ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) + ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.', true) ->inject('response') ->action(function ($url, $width, $height, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -367,7 +367,7 @@ App::get('/v1/avatars/qr') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') - ->param('size', 400, new Range(0, 1000), 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) + ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) ->param('download', false, new Boolean(true), 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true) ->inject('response') diff --git a/composer.lock b/composer.lock index 6d052aed1c..ea07e51fea 100644 --- a/composer.lock +++ b/composer.lock @@ -6576,5 +6576,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/docs/references/avatars/get-browser.md b/docs/references/avatars/get-browser.md index 8bc41911e8..616439a470 100644 --- a/docs/references/avatars/get-browser.md +++ b/docs/references/avatars/get-browser.md @@ -1 +1,3 @@ -You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. \ No newline at end of file +You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. \ No newline at end of file diff --git a/docs/references/avatars/get-credit-card.md b/docs/references/avatars/get-credit-card.md index 8e7fb59bbd..5cf76176d3 100644 --- a/docs/references/avatars/get-credit-card.md +++ b/docs/references/avatars/get-credit-card.md @@ -1 +1,3 @@ -The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. \ No newline at end of file +The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. diff --git a/docs/references/avatars/get-flag.md b/docs/references/avatars/get-flag.md index ba7f230e14..04a8bbca64 100644 --- a/docs/references/avatars/get-flag.md +++ b/docs/references/avatars/get-flag.md @@ -1 +1,3 @@ -You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. \ No newline at end of file +You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. diff --git a/docs/references/avatars/get-image.md b/docs/references/avatars/get-image.md index 508ece8a34..efd654b362 100644 --- a/docs/references/avatars/get-image.md +++ b/docs/references/avatars/get-image.md @@ -1 +1,3 @@ -Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. \ No newline at end of file +Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. diff --git a/docs/references/avatars/get-initials.md b/docs/references/avatars/get-initials.md index 87dafd3afb..610e2611e8 100644 --- a/docs/references/avatars/get-initials.md +++ b/docs/references/avatars/get-initials.md @@ -1,3 +1,5 @@ Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. -You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. \ No newline at end of file +You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. diff --git a/docs/references/avatars/get-qr.md b/docs/references/avatars/get-qr.md index 54c6c3588a..3218d28cf9 100644 --- a/docs/references/avatars/get-qr.md +++ b/docs/references/avatars/get-qr.md @@ -1 +1 @@ -Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. \ No newline at end of file +Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.