ossn.lib.image.php File Reference

Go to the source code of this file.

Namespaces

 Informatikon\com
 

Functions

 ossn_image_resize_parameters ($width, $height, $options)
 
 ossn_resize_image ($input_name, $maxwidth, $maxheight, $square=FALSE, $x1=0, $y1=0, $x2=0, $y2=0, $upscale=FALSE)
 
 ossn_save_image ($file, $destination)
 
 ossn_user_image_sizes ()
 

Function Documentation

ossn_image_resize_parameters (   $width,
  $height,
  $options 
)

Calculate the parameters for resizing an image

Parameters
int$widthWidth of the original image
int$heightHeight of the original image
array$optionsSee $defaults for the options
Returns
resource or FALSE

Definition at line 21 of file ossn.lib.image.php.

ossn_resize_image (   $input_name,
  $maxwidth,
  $maxheight,
  $square = FALSE,
  $x1 = 0,
  $y1 = 0,
  $x2 = 0,
  $y2 = 0,
  $upscale = FALSE 
)

Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file was not an image)

Parameters
string$input_nameThe name of the file on the disk
int$maxwidthThe desired width of the resized image
int$maxheightThe desired height of the resized image
bool$squareIf set to true, takes the smallest of maxwidth and maxheight and use it to set the dimensions on the new image. If no crop parameters are set, the largest square that fits in the image centered will be used for the resize. If square, the crop must be a square region.
int$x1x coordinate for top, left corner
int$y1y coordinate for top, left corner
int$x2x coordinate for bottom, right corner
int$y2y coordinate for bottom, right corner
bool$upscaleResize images smaller than $maxwidth x $maxheight?
Returns
false|string The contents of the resized image, or false on failure

Definition at line 149 of file ossn.lib.image.php.

ossn_save_image (   $file,
  $destination 
)

Convert image to jpeg and compress it

Returns
The contents of generate image

Definition at line 226 of file ossn.lib.image.php.

ossn_user_image_sizes ( )

Get image crop sizes for profile picture

Returns
The contents of generate image

Definition at line 244 of file ossn.lib.image.php.