Code Duplication    Length = 5-5 lines in 2 locations

Alpha/View/Widget/Image.php 2 locations

@@ 334-338 (lines=5) @@
331
                imagefilledrectangle($im, 0, 0, $this->width->getValue(), $this->height->getValue(), $bgc);
332
333
                imagestring($im, 1, 5, 5, "Error loading $this->source", $tc);
334
                if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) {
335
                    imagepng($im);
336
                } else {
337
                    imagejpeg($im);
338
                }
339
                imagedestroy($im);
340
            } else {
341
                // the dimensions of the source image
@@ 365-369 (lines=5) @@
362
                // copy the old image to the new image (in memory, not the file!)
363
                imagecopyresampled($new_image, $old_image, 0, 0, 0, 0, $this->width->getValue(), $this->height->getValue(), $oldWidth, $oldHeight);
364
365
                if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) {
366
                    imagepng($new_image);
367
                } else {
368
                    imagejpeg($new_image, null, 100 * $this->quality->getValue());
369
                }
370
371
                $this->cache($new_image);
372
                imagedestroy($old_image);