The expression return imagecreatefromjpeg($filename) could return the type resource which is incompatible with the type-hinted return GdImage. Consider adding an additional type-check to rule them out.
Loading history...
14
}
15
16
1
public function save(GdImage $resource, string $filename, int $compression): void
17
{
18
1
\imagejpeg($resource, $filename, $compression);
19
}
20
21
1
public function getContentType(): string
22
{
23
1
return 'image/jpeg';
24
}
25
26
4
public function render(GdImage $resource): void
27
{
28
4
\imagejpeg($resource);
29
}
30
31
1
public function handleTransparency(GdImage $newImage, GdImage $image): void