| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function getBetterQuality() |
||
| 40 | { |
||
| 41 | $quality = 0; |
||
| 42 | $better = 0; |
||
| 43 | |||
| 44 | foreach ($this->image as $index => $image) { |
||
| 45 | $q = $image->getImageDepth() + ($image->getImageWidth() * $image->getImageHeight()); |
||
| 46 | |||
| 47 | if ($q > $quality) { |
||
| 48 | $quality = $q; |
||
| 49 | $better = $index; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | $this->image->setIteratorIndex($better); |
||
| 54 | |||
| 55 | $better = new Image(new ImagickLib($this->image)); |
||
| 56 | $better->format('png'); |
||
| 57 | |||
| 58 | return $better; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |