src/Gregwar/Captcha/CaptchaBuilder.php
protected function createBackgroundImageFromType($backgroundImage, $imageType)
    {
        switch ($imageType) {
            case 'image/jpeg':
                $image = imagecreatefromjpeg($backgroundImage);
                break;
            case 'image/png':
                $image = imagecreatefrompng($backgroundImage);
                break;
            case 'image/gif':
                $image = imagecreatefromgif($backgroundImage);
                break;

            default:
                throw new Exception('Not supported file type for background image!');
                break;
        }

        return $image;
    }
protected function createBackgroundImageFromType($backgroundImage, $imageType)
    {
        switch ($imageType) {
            case 'image/jpeg':
                $image = imagecreatefromjpeg($backgroundImage);
                break;
            case 'image/png':
                $image = imagecreatefrompng($backgroundImage);
                break;
            case 'image/gif':
                $image = imagecreatefromgif($backgroundImage);
                break;

            default:
                throw new Exception('Not supported file type for background image!');
                break;
        }

        return $image;
    }
protected function createBackgroundImageFromType ( $ backgroundImage , $ imageType ) { switch ( $ imageType ) { case 'image/jpeg' : $ image = imagecreatefromjpeg ( $ backgroundImage ) ; break ; case 'image/png' : $ image = imagecreatefrompng ( $ backgroundImage ) ; break ; case 'image/gif' : $ image = imagecreatefromgif ( $ backgroundImage ) ; break ; default : throw new Exception ( 'Not supported file type for background image!' ) ; break ; } return $ image ; }
Create background image from type

@param string $backgroundImage
@param string $imageType
@return resource
@throws Exception
Create background image from type