final protected function createImageFromFile($file, $type)
    {
        switch ($type) {
            case \IMAGETYPE_GIF:
                return imagecreatefromgif($file);

            case \IMAGETYPE_JPEG:
                return imagecreatefromjpeg($file);

            case \IMAGETYPE_PNG:
                return imagecreatefrompng($file);
    
            default:
                throw new LogicException(sprintf('Can not create image from "%s"', $file));
        }
    }
final protected function createImageFromFile($file, $type)
    {
        switch ($type) {
            case \IMAGETYPE_GIF:
                return imagecreatefromgif($file);

            case \IMAGETYPE_JPEG:
                return imagecreatefromjpeg($file);

            case \IMAGETYPE_PNG:
                return imagecreatefrompng($file);
    
            default:
                throw new LogicException(sprintf('Can not create image from "%s"', $file));
        }
    }
final protected function createImageFromFile ( $ file , $ type ) { switch ( $ type ) { case \ IMAGETYPE_GIF : return imagecreatefromgif ( $ file ) ; case \ IMAGETYPE_JPEG : return imagecreatefromjpeg ( $ file ) ; case \ IMAGETYPE_PNG : return imagecreatefrompng ( $ file ) ; default : throw new LogicException ( sprintf ( 'Can not create image from "%s"' , $ file ) ) ; } }
Loads an image into the memory from a file-system or URL

@param string $file
@throws \LogicException When attempting to create from unsupported format
@return resource
Loads an image into the memory from a file - system or URL