chore: remove plan blocking

This commit is contained in:
Chirag Aggarwal
2025-02-27 09:52:27 +00:00
parent ae78e793dd
commit f31acd214e
3 changed files with 1 additions and 14 deletions
-5
View File
@@ -480,11 +480,6 @@ return [
'description' => 'The requested file is not publicly readable.',
'code' => 403,
],
Exception::STORAGE_FILE_PREVIEW_BLOCKED => [
'name' => Exception::STORAGE_FILE_PREVIEW_BLOCKED,
'description' => 'File preview is not available on your pricing current tier.',
'code' => 403,
],
/** VCS */
Exception::INSTALLATION_NOT_FOUND => [
+1 -8
View File
@@ -936,12 +936,11 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true)
->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true)
->inject('response')
->inject('plan')
->inject('dbForProject')
->inject('deviceForFiles')
->inject('deviceForLocal')
->inject('queueForStatsUsage')
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Response $response, array $plan, Database $dbForProject, Device $deviceForFiles, Device $deviceForLocal, StatsUsage $queueForStatsUsage) {
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Response $response, Database $dbForProject, Device $deviceForFiles, Device $deviceForLocal, StatsUsage $queueForStatsUsage) {
if (!\extension_loaded('imagick')) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing');
@@ -963,12 +962,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
throw new Exception(Exception::USER_UNAUTHORIZED);
}
if (isset($plan['imageTransformations'])) {
if ($plan['imageTransformations'] === -1) {
throw new Exception(Exception::STORAGE_FILE_PREVIEW_BLOCKED);
}
}
if ($fileSecurity && !$valid) {
$file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId);
} else {
-1
View File
@@ -143,7 +143,6 @@ class Exception extends \Exception
public const STORAGE_INVALID_RANGE = 'storage_invalid_range';
public const STORAGE_INVALID_APPWRITE_ID = 'storage_invalid_appwrite_id';
public const STORAGE_FILE_NOT_PUBLIC = 'storage_file_not_public';
public const STORAGE_FILE_PREVIEW_BLOCKED = 'storage_file_preview_blocked';
/** VCS */
public const INSTALLATION_NOT_FOUND = 'installation_not_found';