The expression return imagecreatefromjpeg($filename) also could return the type GdImage which is incompatible with the documented return type null|resource.
Loading history...
14
}
15
16
/**
17
* @param resource $resource
18
* @param string $filename
19
* @param int $compression
20
*/
21
1
public function save($resource, string $filename, int $compression): void
22
{
23
1
\imagejpeg($resource, $filename, $compression);
24
1
}
25
26
/**
27
* @return string
28
*/
29
1
public function getContentType(): string
30
{
31
1
return 'image/jpeg';
32
}
33
34
/**
35
* @param resource $resource
36
*/
37
4
public function render($resource): void
38
{
39
4
\imagejpeg($resource);
40
4
}
41
42
/**
43
* @param resource $newImage
44
* @param resource $image
45
*/
46
1
public function handleTransparency($newImage, $image): void