1
0
Fork 0
mirror of synced 2024-06-15 01:04:51 +12:00

fix issue with opacity

This commit is contained in:
Damodar Lohani 2021-04-09 13:27:45 +05:45
parent d82bb692b2
commit b7920ab26c

View file

@ -342,10 +342,15 @@ App::get('/v1/storage/files/:fileId/preview')
$image = new Image($source);
$image->crop((int) $width, (int) $height);
if (!empty($opacity)) {
$image->setOpacity($opacity);
}
if (!empty($background)) {
$image->setBackground('#'.$background);
}
if (!empty($borderWidth) ) {
$image->setBorder($borderWidth, '#'.$borderColor);
@ -355,10 +360,6 @@ App::get('/v1/storage/files/:fileId/preview')
$image->setBorderRadius($borderRadius);
}
if (!empty($opacity)) {
$image->setOpacity($opacity);
}
if (!empty($rotation)) {
$image->setRotation($rotation);
}
@ -367,7 +368,7 @@ App::get('/v1/storage/files/:fileId/preview')
$data = $image->output($output, $quality);
// $cache->save($key, $data);
$cache->save($key, $data);
$response
->setContentType($outputs[$output])