phpDocumentor files
[ class tree: files ] [ index: files ] [ all elements ]

Procedural File: _image.funcs.php

Source Location: /qp_inc/files/model/_image.funcs.php

Page Details

This file implements various Image File handling functions.

This file is part of Quam Plures - http://quamplures.net/ See also https://launchpad.net/quam-plures.

Author:  fplanque: Francois PLANQUE.
Copyright:  (c) 2009 - 2011 by the Quam Plures developers - http://quamplures.net/
Copyright:  

(c)2003-2009 by Francois PLANQUE - http://fplanque.net/

Filesource:  Source Code for this file
Functions
crop_to_constraint  [line 57]

void crop_to_constraint( integer $src_width, integer $src_height, integer $max_width, integer $max_height  )

Crop dimensions to fit into a constrained size, while preserving aspect ratio.

Parameters:
integer   $src_width:  source width
integer   $src_height:  source height
integer   $max_width:  constrained width
integer   $max_height:  constrained height


[ Top ]
fit_into_constraint  [line 112]

void fit_into_constraint( integer $src_width, integer $src_height, integer $max_width, integer $max_height  )

Scale dimensions to fit into a constrained size, while preserving aspect ratio.

The scaling only happens if the source is larger than the constraint.

Parameters:
integer   $src_width:  source width
integer   $src_height:  source height
integer   $max_width:  constrained width
integer   $max_height:  constrained height


[ Top ]
generate_thumb  [line 251]

array generate_thumb( $src_imh, $thumb_type, $thumb_width, $thumb_height  )

Generate a thumbnail

Parameters:
   $src_imh: 
   $thumb_type: 
   $thumb_width: 
   $thumb_height: 

API Tags:
Return:  short error code + dest image handler


[ Top ]
get_available_thumb_sizes  [line 34]

array get_available_thumb_sizes( )

API Tags:
Return:  'key'=>'name'


[ Top ]
load_image  [line 130]

array load_image( string $path, string $mimetype  )

Load an image from a file into memory

Parameters:
string   $path:  pathname of image file
string   $mimetype: 

API Tags:
Return:  resource image handle or NULL


[ Top ]
output_image  [line 218]

string output_image( resource $imh, string $mimetype  )

Output an image from memory to web client

Parameters:
resource   $imh:  image handle
string   $mimetype: 


[ Top ]
save_image  [line 172]

string save_image( resource $imh, string $path, string $mimetype, [integer $quality = 90], [string $chmod = NULL]  )

Output an image from memory to web client

Parameters:
resource   $imh:  image handle
string   $path:  pathname of image file
string   $mimetype: 
integer   $quality: 
string   $chmod:  permissions


[ Top ]
scale_to_constraint  [line 85]

void scale_to_constraint( integer $src_width, integer $src_height, integer $max_width, integer $max_height  )

Scale dimensions to fit into a constrained size, while preserving aspect ratio.

Parameters:
integer   $src_width:  source width
integer   $src_height:  source height
integer   $max_width:  constrained width
integer   $max_height:  constrained height


[ Top ]