Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/Controller/PreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public function __construct(
* Get a preview by file path
*
* @param string $file Path of the file
* @param int $x Width of the preview
* @param int $y Height of the preview
* @param bool $a Whether to not crop the preview
* @param int $x Width of the preview. A width of -1 will use the original image width.
* @param int $y Height of the preview. A height of -1 will use the original image height.
* @param bool $a Preserve the aspect ratio
* @param bool $forceIcon Force returning an icon
* @param string $mode How to crop the image
* @param 'fill'|'cover' $mode How to crop the image
* @param bool $mimeFallback Whether to fallback to the mime icon if no preview is available
* @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>|RedirectResponse<Http::STATUS_SEE_OTHER, array{}>
*
Expand Down Expand Up @@ -105,11 +105,11 @@ public function getPreview(
* Get a preview by file ID
*
* @param int $fileId ID of the file
* @param int $x Width of the preview
* @param int $y Height of the preview
* @param bool $a Whether to not crop the preview
* @param int $x Width of the preview. A width of -1 will use the original image width.
* @param int $y Height of the preview. A height of -1 will use the original image height.
* @param bool $a Preserve the aspect ratio
* @param bool $forceIcon Force returning an icon
* @param string $mode How to crop the image
* @param 'fill'|'cover' $mode How to crop the image
* @param bool $mimeFallback Whether to fallback to the mime icon if no preview is available
* @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>|RedirectResponse<Http::STATUS_SEE_OTHER, array{}>
*
Expand Down
24 changes: 16 additions & 8 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6212,7 +6212,7 @@
{
"name": "x",
"in": "query",
"description": "Width of the preview",
"description": "Width of the preview. A width of -1 will use the original image width.",
"schema": {
"type": "integer",
"format": "int64",
Expand All @@ -6222,7 +6222,7 @@
{
"name": "y",
"in": "query",
"description": "Height of the preview",
"description": "Height of the preview. A height of -1 will use the original image height.",
"schema": {
"type": "integer",
"format": "int64",
Expand All @@ -6232,7 +6232,7 @@
{
"name": "a",
"in": "query",
"description": "Whether to not crop the preview",
"description": "Preserve the aspect ratio",
"schema": {
"type": "integer",
"default": 0,
Expand Down Expand Up @@ -6261,7 +6261,11 @@
"description": "How to crop the image",
"schema": {
"type": "string",
"default": "fill"
"default": "fill",
"enum": [
"fill",
"cover"
]
}
},
{
Expand Down Expand Up @@ -6356,7 +6360,7 @@
{
"name": "x",
"in": "query",
"description": "Width of the preview",
"description": "Width of the preview. A width of -1 will use the original image width.",
"schema": {
"type": "integer",
"format": "int64",
Expand All @@ -6366,7 +6370,7 @@
{
"name": "y",
"in": "query",
"description": "Height of the preview",
"description": "Height of the preview. A height of -1 will use the original image height.",
"schema": {
"type": "integer",
"format": "int64",
Expand All @@ -6376,7 +6380,7 @@
{
"name": "a",
"in": "query",
"description": "Whether to not crop the preview",
"description": "Preserve the aspect ratio",
"schema": {
"type": "integer",
"default": 0,
Expand Down Expand Up @@ -6405,7 +6409,11 @@
"description": "How to crop the image",
"schema": {
"type": "string",
"default": "fill"
"default": "fill",
"enum": [
"fill",
"cover"
]
}
},
{
Expand Down