| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | protected function getIcon() |
||
| 14 | { |
||
| 15 | $aspect = $this->video->width / $this->video->height; |
||
| 16 | |||
| 17 | // Map minimum aspect ratio to the corresponding icon. |
||
| 18 | // Borrowed from https://github.com/xbmc/xbmc/blob/master/xbmc/utils/StreamDetails.cpp |
||
| 19 | $map = array( |
||
| 20 | '1.3499'=>'50px-1.33', |
||
| 21 | '1.5080'=>'50px-1.37', |
||
| 22 | '1.8147'=>'50px-1.66', |
||
| 23 | '2.0174'=>'50px-1.85', |
||
| 24 | '2.2738'=>'50px-2.20', |
||
| 25 | '2.3749'=>'50px-2.35', |
||
| 26 | '2.4739'=>'50px-2.40', |
||
| 27 | '2.6529'=>'50px-2.55'); |
||
| 28 | |||
| 29 | foreach ($map as $ratio=> $icon) |
||
| 30 | if ($aspect < $ratio) |
||
| 31 | return $icon; |
||
| 32 | |||
| 33 | return '50px-2.76'; |
||
| 34 | } |
||
| 36 | } |