Conditions | 4 |
Paths | 0 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
53 | public function modify($image) |
||
54 | { |
||
55 | try { |
||
56 | if ($this->get() != 0) { |
||
57 | |||
58 | $imageWithContrast = $image; |
||
59 | |||
60 | if (!imagefilter($imageWithContrast, IMG_FILTER_CONTRAST, $this->get())) { |
||
61 | throw new \Exception('Fail to apply contrast in image.'); |
||
62 | } |
||
63 | |||
64 | $image = $imageWithContrast; |
||
65 | } |
||
66 | } catch (\Exception $e) { |
||
67 | ResponseHandler::fail($e->getMessage()); |
||
68 | } finally { |
||
69 | return $image; |
||
70 | } |
||
73 |