original_string: public function init($data)
      {
          $this->data = $data;
  
          switch (true) {
  
              case $this->isGdResource():
                  return $this->initFromGdResource($this->data);
  
              case $this->isImagick():
                  return $this->initFromImagick($this->data);
  
              case $this->isInterventionImage():
                  return $this->initFromInterventionImage($this->data);
  
              case $this->isSplFileInfo():
                  return $this->initFromPath($this->data->getRealPath());
  
              case $this->isBinary():
                  return $this->initFromBinary($this->data);
  
              case $this->isUrl():
                  return $this->initFromUrl($this->data);
  
              case $this->isStream():
                  return $this->initFromStream($this->data);
  
              case $this->isDataUrl():
                  return $this->initFromBinary($this->decodeDataUrl($this->data));
  
              case $this->isFilePath():
                  return $this->initFromPath($this->data);
  
              // isBase64 has to be after isFilePath to prevent false positives
              case $this->isBase64():
                  return $this->initFromBinary(base64_decode($this->data));
  
              default:
                  throw new Exception\NotReadableException("Image source not readable");
          }
      }
code: public function init($data)
      {
          $this->data = $data;
  
          switch (true) {
  
              case $this->isGdResource():
                  return $this->initFromGdResource($this->data);
  
              case $this->isImagick():
                  return $this->initFromImagick($this->data);
  
              case $this->isInterventionImage():
                  return $this->initFromInterventionImage($this->data);
  
              case $this->isSplFileInfo():
                  return $this->initFromPath($this->data->getRealPath());
  
              case $this->isBinary():
                  return $this->initFromBinary($this->data);
  
              case $this->isUrl():
                  return $this->initFromUrl($this->data);
  
              case $this->isStream():
                  return $this->initFromStream($this->data);
  
              case $this->isDataUrl():
                  return $this->initFromBinary($this->decodeDataUrl($this->data));
  
              case $this->isFilePath():
                  return $this->initFromPath($this->data);
  
              // isBase64 has to be after isFilePath to prevent false positives
              case $this->isBase64():
                  return $this->initFromBinary(base64_decode($this->data));
  
              default:
                  throw new Exception\NotReadableException("Image source not readable");
          }
      }
code_tokens: public function init ( $ data ) { $ this -> data = $ data ; switch ( true ) { case $ this -> isGdResource ( ) : return $ this -> initFromGdResource ( $ this -> data ) ; case $ this -> isImagick ( ) : return $ this -> initFromImagick ( $ this -> data ) ; case $ this -> isInterventionImage ( ) : return $ this -> initFromInterventionImage ( $ this -> data ) ; case $ this -> isSplFileInfo ( ) : return $ this -> initFromPath ( $ this -> data -> getRealPath ( ) ) ; case $ this -> isBinary ( ) : return $ this -> initFromBinary ( $ this -> data ) ; case $ this -> isUrl ( ) : return $ this -> initFromUrl ( $ this -> data ) ; case $ this -> isStream ( ) : return $ this -> initFromStream ( $ this -> data ) ; case $ this -> isDataUrl ( ) : return $ this -> initFromBinary ( $ this -> decodeDataUrl ( $ this -> data ) ) ; case $ this -> isFilePath ( ) : return $ this -> initFromPath ( $ this -> data ) ; // isBase64 has to be after isFilePath to prevent false positives case $ this -> isBase64 ( ) : return $ this -> initFromBinary ( base64_decode ( $ this -> data ) ) ; default : throw new Exception \ NotReadableException ( "Image source not readable" ) ; } }
docstring: Initiates new image from mixed data
  
  @param  mixed $data
  @return \Intervention\Image\Image
docstring_tokens: Initiates new image from mixed data