SproutCMS

This is the code documentation for the SproutCMS project

function parseSizeString()

Parse the size string used in file/resize and some helpers.

Syntax: [crm]{number}x{number}(-[lcr][tcb])(~{number})
        Type  Width    Height    Crop X Y     Quality

Returns an array.
  [0] type, either 'r', 'c' or 'm'
      r = resize, up or down, try to fill the area requested
      c = crop, resulting file will always be the width and height requested
      m = resize down only
  [1] width
  [2] height
  [3] x position, 'left', 'center' or 'right'
  [4] y position, 'top', 'center' or 'bottom'
  [5] jpeg quality, 0 = worst, 100 = best

Returns an empty array on error (so you can use list() safely)

Usage

array File::parseSizeString ( Size $str );

Arguments

  1. Size $str
    string

Return value

  • array