original_string: public function generate_image_thumbnail($width, $height) {
          global $CFG;
          require_once($CFG->libdir . '/gdlib.php');
  
          if (empty($width) or empty($height)) {
              return false;
          }
  
          $content = $this->get_content();
  
          // Fetch the image information for this image.
          $imageinfo = @getimagesizefromstring($content);
          if (empty($imageinfo)) {
              return false;
          }
  
          // Create a new image from the file.
          $original = @imagecreatefromstring($content);
  
          // Generate the thumbnail.
          return generate_image_thumbnail_from_image($original, $imageinfo, $width, $height);
      }
code: public function generate_image_thumbnail($width, $height) {
          global $CFG;
          require_once($CFG->libdir . '/gdlib.php');
  
          if (empty($width) or empty($height)) {
              return false;
          }
  
          $content = $this->get_content();
  
          // Fetch the image information for this image.
          $imageinfo = @getimagesizefromstring($content);
          if (empty($imageinfo)) {
              return false;
          }
  
          // Create a new image from the file.
          $original = @imagecreatefromstring($content);
  
          // Generate the thumbnail.
          return generate_image_thumbnail_from_image($original, $imageinfo, $width, $height);
      }
code_tokens: public function generate_image_thumbnail ( $ width , $ height ) { global $ CFG ; require_once ( $ CFG -> libdir . '/gdlib.php' ) ; if ( empty ( $ width ) or empty ( $ height ) ) { return false ; } $ content = $ this -> get_content ( ) ; // Fetch the image information for this image. $ imageinfo = @ getimagesizefromstring ( $ content ) ; if ( empty ( $ imageinfo ) ) { return false ; } // Create a new image from the file. $ original = @ imagecreatefromstring ( $ content ) ; // Generate the thumbnail. return generate_image_thumbnail_from_image ( $ original , $ imageinfo , $ width , $ height ) ; }
docstring: Generates a thumbnail for this stored_file.
  
  If the GD library has at least version 2 and PNG support is available, the returned data
  is the content of a transparent PNG file containing the thumbnail. Otherwise, the function
  returns contents of a JPEG file with black background containing the thumbnail.
  
  @param   int $width the width of the requested thumbnail
  @param   int $height the height of the requested thumbnail
  @return  string|bool false if a problem occurs, the thumbnail image data otherwise
docstring_tokens: Generates a thumbnail for this stored_file .