We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdee2ae commit 5f537efCopy full SHA for 5f537ef
1 file changed
src/ScaledUploads.php
@@ -7,6 +7,7 @@
7
use SilverStripe\Core\Config\Configurable;
8
use SilverStripe\Core\Environment;
9
use SilverStripe\Core\Extension;
10
+use Intervention\Image\Exception\NotSupportedException;
11
12
/**
13
* Automatically scale down uploaded images
@@ -189,9 +190,12 @@ private function scaleUploadedImage($file)
189
190
if ($switch_orientation) {
191
$modified = true;
192
// orientate() is available in Intervention Image 2.5+, but is automatic in 3+
- if (method_exists($transformed->getImageResource(), 'orientate')) {
193
+ try {
194
$transformed->setImageResource($transformed->getImageResource()->orientate());
195
}
196
+ catch (NotSupportedException $e) {
197
+ // noop - driver/backend ondersteunt het niet
198
+ }
199
200
201
0 commit comments