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