fix output type
This commit is contained in:
parent
935430c3e3
commit
7d32f84cc2
|
@ -950,9 +950,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
|||
$cache = new Cache(new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId() . DIRECTORY_SEPARATOR . $bucketId . DIRECTORY_SEPARATOR . $fileId)); // Limit file number or size
|
||||
$data = $cache->load($key, 60 * 60 * 24 * 30 * 3/* 3 months */);
|
||||
|
||||
$output = (empty($output)) ? ( empty($type) ? 'jpg' : $type ) : $output;
|
||||
if ($data) {
|
||||
$output = (empty($output)) ? ( empty($type) ? 'jpg' : $type ) : $output;
|
||||
|
||||
return $response
|
||||
->setContentType((\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'])
|
||||
->addHeader('Expires', $date)
|
||||
|
@ -1002,8 +1001,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
|||
$image->setRotation(($rotation + 360) % 360);
|
||||
}
|
||||
|
||||
$output = (empty($output)) ? $type : $output;
|
||||
|
||||
$data = $image->output($output, $quality);
|
||||
|
||||
$cache->save($key, $data);
|
||||
|
|
Loading…
Reference in a new issue