Conditions | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | """ |
||
23 | def apply(self, resource): |
||
24 | """ |
||
25 | Apply filter to resource |
||
26 | :param resource: Image |
||
27 | :return: Image |
||
28 | """ |
||
29 | if not isinstance(resource, Image.Image): |
||
30 | raise ValueError('Unknown resource format') |
||
31 | |||
32 | resource_format = resource.format |
||
33 | resource = resource.rotate(self.angle, expand=True) |
||
34 | resource.format = resource_format |
||
35 | |||
36 | return resource |
||
37 |