FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Resize Class Reference
Inheritance diagram for Resize:
Handler Thing

Public Member Functions

 read ($handlers, $filename, $params=null)
 
- Public Member Functions inherited from Handler
 __construct ($stream, $config)
 
 search ($handlers, $mask=' *')
 Search for files. More...
 
 exists ($handlers, $filename, $params=null)
 Check if a file exists. More...
 
 time ($handlers, $filename, $params=null)
 Modification time of a file. More...
 
 read ($handlers, $filename, $params=null)
 Read a file. More...
 
 save ($handlers, $filename, $params, $data)
 Save a file. More...
 
 delete ($handlers, $filename, $params=null)
 Save a file. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

 $mode = IMG_BILINEAR_FIXED
 
 $jpegQuality = 80
 
 $widths = []
 Allowed widths (small to large; empty = all). More...
 
 $heights = []
 Allowed heights (small to large; empty = all). More...
 
 $locked = true
 Allowed sizes will be locked together by key. More...
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 index ($sizes, &$size, $other_sizes=null, &$other_size=null)
 Pick the next larger value from an array. More...
 
 dimensions ($orig_width, $orig_height, &$new_width, &$new_height)
 Calculate the dimensions for the image. More...
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Additional Inherited Members

- Protected Attributes inherited from Handler
 $_stream
 
 $_config = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Definition at line 5 of file Resize.php.

Member Function Documentation

◆ dimensions()

dimensions (   $orig_width,
  $orig_height,
$new_width,
$new_height 
)
protected

Calculate the dimensions for the image.

Taking into account missing dimensions, restrictions, and locking.

Parameters
int$orig_widthWidth of the original image.
int$orig_heightHeight of the original image.
int$new_widthIn: requested width; out: calculated width.
int$new_heightIn: requested height; out: calculated height.

Definition at line 37 of file Resize.php.

◆ index()

index (   $sizes,
$size,
  $other_sizes = null,
$other_size = null 
)
protected

Pick the next larger value from an array.

Parameters
array$sizesAllowed sizes.
int$sizeCurrent size.
array$other_sizesAllowed sizes for other dimension.
int$other_sizeCurrent size for other dimension (will be adapted when locked).

Definition at line 20 of file Resize.php.

◆ read()

read (   $handlers,
  $filename,
  $params = null 
)

Definition at line 44 of file Resize.php.

Field Documentation

◆ $heights

$heights = []

Allowed heights (small to large; empty = all).

Definition at line 10 of file Resize.php.

◆ $jpegQuality

$jpegQuality = 80

Definition at line 8 of file Resize.php.

◆ $locked

$locked = true

Allowed sizes will be locked together by key.

Definition at line 11 of file Resize.php.

◆ $mode

$mode = IMG_BILINEAR_FIXED

Definition at line 7 of file Resize.php.

◆ $widths

$widths = []

Allowed widths (small to large; empty = all).

Definition at line 9 of file Resize.php.


The documentation for this class was generated from the following file: