| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 5.9862 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | 5 | public function render() |
|
| 12 | { |
||
| 13 | 5 | $pathThumbnail = $this->getPresentation()->getPresentationProperties()->getThumbnailPath(); |
|
| 14 | |||
| 15 | 5 | if ($pathThumbnail) { |
|
| 16 | $fileThumbnail = file_get_contents($pathThumbnail); |
||
| 17 | $gdImage = imagecreatefromstring($fileThumbnail); |
||
| 18 | if ($gdImage) { |
||
| 19 | ob_start(); |
||
| 20 | imagejpeg($gdImage); |
||
| 21 | $imageContents = ob_get_contents(); |
||
| 22 | ob_end_clean(); |
||
| 23 | imagedestroy($gdImage); |
||
| 24 | |||
| 25 | $this->getZip()->addFromString('docProps/thumbnail.jpeg', $imageContents); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | // Return |
||
| 30 | 5 | return $this->getZip(); |
|
| 31 | } |
||
| 32 | } |
||
| 33 |