From ab3db2af1bd89de7b8f3250440ea29d2a58adec2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 20 Mar 2022 08:33:40 +0545 Subject: [PATCH] add comment --- app/controllers/api/storage.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 369fc4d3e1..31c9a68ff5 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -945,6 +945,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $data = $cache->load($key, 60 * 60 * 24 * 30 * 3/* 3 months */); if(empty($output)) { + // when file extension is not provided and the mime type is not one of our supported outputs + // we fallback to `jpg` output format $output = empty($type) ? (array_search($mime, $outputs) ?? 'jpg') : $type; }