1 | <?php |
||
2 | /** |
||
3 | * Audio Player |
||
4 | * |
||
5 | * This file is licensed under the Affero General Public License version 3 or |
||
6 | * later. See the LICENSE.md file. |
||
7 | * |
||
8 | * @author Marcel Scherello <[email protected]> |
||
9 | * @author Olivier Paroz <[email protected]> |
||
10 | * @copyright 2016-2021 Marcel Scherello |
||
11 | */ |
||
12 | |||
13 | namespace OCA\audioplayer\Http; |
||
14 | |||
15 | use OCP\AppFramework\Http\Response; |
||
16 | use OCP\AppFramework\Http; |
||
17 | |||
18 | /** |
||
19 | * A renderer for cover arts |
||
20 | */ |
||
21 | class ImageResponse extends Response |
||
22 | { |
||
23 | |||
24 | private $preview; |
||
25 | |||
26 | /** |
||
27 | * @param array $image image meta data |
||
28 | * @param int $statusCode the Http status code, defaults to 200 |
||
29 | */ |
||
30 | public function __construct(array $image, $statusCode = Http::STATUS_OK) |
||
31 | { |
||
32 | $this->preview = $image['content']; |
||
33 | $this->setStatus($statusCode); |
||
34 | $this->addHeader('Content-type', $image['mimetype'] . '; charset=utf-8'); |
||
35 | $this->cacheFor(365 * 24 * 60 * 60); |
||
36 | $etag = md5($image['content']); |
||
37 | $this->setETag($etag); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Returns the rendered image |
||
42 | * |
||
43 | * @return string the file |
||
44 | */ |
||
45 | public function render() |
||
46 | { |
||
47 | if ($this->preview instanceof \OC_Image) { |
||
0 ignored issues
–
show
|
|||
48 | return $this->preview->data(); |
||
49 | } else { |
||
50 | return $this->preview; |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths