Skip to content

Commit eb1e44c

Browse files
committed
Updated preview controller
1 parent cfbc321 commit eb1e44c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/controllers/api/storage.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,17 @@ function ($fileId, $width, $height, $quality, $background, $output) use ($reques
429429

430430
$output = (empty($output)) ? $type : $output;
431431

432+
$data = $resize->output($output, $quality);
433+
434+
$cache->save($key, $data);
435+
432436
$response
433437
->setContentType($outputs[$output])
434438
->addHeader('Expires', $date)
435439
->addHeader('X-Appwrite-Cache', 'miss')
436-
->send('')
440+
->send($data)
437441
;
438442

439-
$data = $resize->output($output, $quality);
440-
441-
$cache->save($key, $data);
442-
443-
echo $data;
444-
445443
unset($resize);
446444
}
447445
);

0 commit comments

Comments
 (0)