Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15487936
D14528.id35144.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14528.id35144.diff
View Options
diff --git a/src/applications/files/config/PhabricatorFilesConfigOptions.php b/src/applications/files/config/PhabricatorFilesConfigOptions.php
--- a/src/applications/files/config/PhabricatorFilesConfigOptions.php
+++ b/src/applications/files/config/PhabricatorFilesConfigOptions.php
@@ -176,7 +176,11 @@
'must be installed and the "%s" binary must be available to '.
'the webserver for this to work.',
'convert')),
-
+ $this->newOption('files.image-transform-size-limit', 'int', 4194304)
+ ->setDescription(
+ pht('Images larger than this size will not be rescaled'))
+ ->addExample(4194304, pht('Limit to 4MB'))
+ ->addExample(8388608, pht('Limit to 8MB')),
);
}
diff --git a/src/applications/files/transform/PhabricatorFileImageTransform.php b/src/applications/files/transform/PhabricatorFileImageTransform.php
--- a/src/applications/files/transform/PhabricatorFileImageTransform.php
+++ b/src/applications/files/transform/PhabricatorFileImageTransform.php
@@ -259,7 +259,8 @@
$file = $this->file;
- $max_size = (1024 * 1024 * 4);
+ $max_size = PhabricatorEnv::getEnvConfig(
+ 'files.image-transform-size-limit');
$img_size = $file->getByteSize();
if ($img_size > $max_size) {
throw new Exception(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 11, 6:16 PM (5 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7724264
Default Alt Text
D14528.id35144.diff (1 KB)
Attached To
Mode
D14528: Increase the maximum size eligible for image transforms configurable from 4MB->16MB
Attached
Detach File
Event Timeline
Log In to Comment