Merge branch 'master' of github.com:appwrite/appwrite into feat-database-indexing
This commit is contained in:
commit
fe5de87563
3 changed files with 26 additions and 25 deletions
|
@ -225,6 +225,7 @@ App::get('/v1/storage/files/:fileId/preview')
|
||||||
->param('fileId', '', new UID(), 'File unique ID')
|
->param('fileId', '', new UID(), 'File unique ID')
|
||||||
->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
|
->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
|
||||||
->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true)
|
->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true)
|
||||||
|
->param('gravity', Image::GRAVITY_CENTER, new WhiteList([Image::GRAVITY_CENTER, Image::GRAVITY_NORTH, Image::GRAVITY_NORTHWEST, Image::GRAVITY_NORTHEAST, Image::GRAVITY_WEST, Image::GRAVITY_EAST, Image::GRAVITY_SOUTHWEST, Image::GRAVITY_SOUTH, Image::GRAVITY_SOUTHEAST]), 'Image crop gravity', true)
|
||||||
->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
||||||
->param('borderWidth', 0, new Range(0, 100), 'Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.', true)
|
->param('borderWidth', 0, new Range(0, 100), 'Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.', true)
|
||||||
->param('borderColor', '', new HexColor(), 'Preview image border color. Use a valid HEX color, no # is needed for prefix.', true)
|
->param('borderColor', '', new HexColor(), 'Preview image border color. Use a valid HEX color, no # is needed for prefix.', true)
|
||||||
|
@ -237,7 +238,7 @@ App::get('/v1/storage/files/:fileId/preview')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('project')
|
->inject('project')
|
||||||
->inject('dbForInternal')
|
->inject('dbForInternal')
|
||||||
->action(function ($fileId, $width, $height, $quality, $borderWidth, $borderColor, $borderRadius, $opacity, $rotation, $background, $output, $request, $response, $project, $dbForInternal) {
|
->action(function ($fileId, $width, $height, $gravity, $quality, $borderWidth, $borderColor, $borderRadius, $opacity, $rotation, $background, $output, $request, $response, $project, $dbForInternal) {
|
||||||
/** @var Utopia\Swoole\Request $request */
|
/** @var Utopia\Swoole\Request $request */
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
/** @var Appwrite\Utopia\Response $response */
|
||||||
/** @var Utopia\Database\Document $project */
|
/** @var Utopia\Database\Document $project */
|
||||||
|
@ -325,7 +326,7 @@ App::get('/v1/storage/files/:fileId/preview')
|
||||||
|
|
||||||
$image = new Image($source);
|
$image = new Image($source);
|
||||||
|
|
||||||
$image->crop((int) $width, (int) $height);
|
$image->crop((int) $width, (int) $height, $gravity);
|
||||||
|
|
||||||
if (!empty($opacity) || $opacity==0) {
|
if (!empty($opacity) || $opacity==0) {
|
||||||
$image->setOpacity($opacity);
|
$image->setOpacity($opacity);
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
"utopia-php/domains": "1.1.*",
|
"utopia-php/domains": "1.1.*",
|
||||||
"utopia-php/swoole": "0.2.*",
|
"utopia-php/swoole": "0.2.*",
|
||||||
"utopia-php/storage": "0.5.*",
|
"utopia-php/storage": "0.5.*",
|
||||||
"utopia-php/image": "0.2.*",
|
"utopia-php/image": "0.3.*",
|
||||||
"resque/php-resque": "1.3.6",
|
"resque/php-resque": "1.3.6",
|
||||||
"matomo/device-detector": "4.2.2",
|
"matomo/device-detector": "4.2.2",
|
||||||
"dragonmantank/cron-expression": "3.1.0",
|
"dragonmantank/cron-expression": "3.1.0",
|
||||||
|
|
44
composer.lock
generated
44
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "0456f223731164e0d43456a74949d8bf",
|
"content-hash": "2d21d6dff0d1764f94854a32d5312b0d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/jwt",
|
"name": "adhocore/jwt",
|
||||||
|
@ -2085,16 +2085,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/image",
|
"name": "utopia-php/image",
|
||||||
"version": "0.2.1",
|
"version": "0.3.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/utopia-php/image.git",
|
"url": "https://github.com/utopia-php/image.git",
|
||||||
"reference": "0754955a165483852184d1215cc3bf659432d23a"
|
"reference": "2044fdd44d87c4253cfe929cca975fd037461b00"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/utopia-php/image/zipball/0754955a165483852184d1215cc3bf659432d23a",
|
"url": "https://api.github.com/repos/utopia-php/image/zipball/2044fdd44d87c4253cfe929cca975fd037461b00",
|
||||||
"reference": "0754955a165483852184d1215cc3bf659432d23a",
|
"reference": "2044fdd44d87c4253cfe929cca975fd037461b00",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2132,9 +2132,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/utopia-php/image/issues",
|
"issues": "https://github.com/utopia-php/image/issues",
|
||||||
"source": "https://github.com/utopia-php/image/tree/0.2.1"
|
"source": "https://github.com/utopia-php/image/tree/0.3.2"
|
||||||
},
|
},
|
||||||
"time": "2021-04-13T07:47:24+00:00"
|
"time": "2021-06-10T09:16:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/locale",
|
"name": "utopia-php/locale",
|
||||||
|
@ -2983,20 +2983,20 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "felixfbecker/advanced-json-rpc",
|
"name": "felixfbecker/advanced-json-rpc",
|
||||||
"version": "v3.2.0",
|
"version": "v3.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
|
"url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
|
||||||
"reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e"
|
"reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/06f0b06043c7438959dbdeed8bb3f699a19be22e",
|
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447",
|
||||||
"reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e",
|
"reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"netresearch/jsonmapper": "^1.0 || ^2.0",
|
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
|
||||||
"php": "^7.1 || ^8.0",
|
"php": "^7.1 || ^8.0",
|
||||||
"phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0"
|
"phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0"
|
||||||
},
|
},
|
||||||
|
@ -3022,9 +3022,9 @@
|
||||||
"description": "A more advanced JSONRPC implementation",
|
"description": "A more advanced JSONRPC implementation",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues",
|
"issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues",
|
||||||
"source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.0"
|
"source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1"
|
||||||
},
|
},
|
||||||
"time": "2021-01-10T17:48:47+00:00"
|
"time": "2021-06-11T22:34:44+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "felixfbecker/language-server-protocol",
|
"name": "felixfbecker/language-server-protocol",
|
||||||
|
@ -3273,16 +3273,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "netresearch/jsonmapper",
|
"name": "netresearch/jsonmapper",
|
||||||
"version": "v2.1.0",
|
"version": "v4.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/cweiske/jsonmapper.git",
|
"url": "https://github.com/cweiske/jsonmapper.git",
|
||||||
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e"
|
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e",
|
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
|
||||||
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e",
|
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3290,10 +3290,10 @@
|
||||||
"ext-pcre": "*",
|
"ext-pcre": "*",
|
||||||
"ext-reflection": "*",
|
"ext-reflection": "*",
|
||||||
"ext-spl": "*",
|
"ext-spl": "*",
|
||||||
"php": ">=5.6"
|
"php": ">=7.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0",
|
"phpunit/phpunit": "~7.5 || ~8.0 || ~9.0",
|
||||||
"squizlabs/php_codesniffer": "~3.5"
|
"squizlabs/php_codesniffer": "~3.5"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
@ -3318,9 +3318,9 @@
|
||||||
"support": {
|
"support": {
|
||||||
"email": "cweiske@cweiske.de",
|
"email": "cweiske@cweiske.de",
|
||||||
"issues": "https://github.com/cweiske/jsonmapper/issues",
|
"issues": "https://github.com/cweiske/jsonmapper/issues",
|
||||||
"source": "https://github.com/cweiske/jsonmapper/tree/master"
|
"source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0"
|
||||||
},
|
},
|
||||||
"time": "2020-04-16T18:48:43+00:00"
|
"time": "2020-12-01T19:48:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nikic/php-parser",
|
"name": "nikic/php-parser",
|
||||||
|
|
Loading…
Reference in a new issue