SproutCMS

This is the code documentation for the SproutCMS project

function base64Thumb()

Generates a cropped, base-64 encoded thumbnail of an image

Usage

false|array File::base64Thumb ( string $file_path , int $width , int $height );

Arguments

  1. string $file_path
    Path to the original image
  2. int $width
    Width to use for thumbnail
  3. int $height
    Height to use for thumbnail

Exceptions thrown

  • Exception
    if not enough RAM to generate thumbnail

Return value

  • array
    Has the following keys:
            'encoded_thumbnail': Base-64 encoded thumbnail
            'original_width': width of the original image
            'original_height': height of the original image
  • false
    If file doesn't exist or can't be recognised as an image