depage-graphics
Loading...
Searching...
No Matches
Gd Class Reference

Detailed Description

The graphics_gd class provides depage::graphics features using the PHP GD extension.

Definition at line 18 of file Gd.php.

Public Member Functions

 render ($input, $output=null)
 Main method for image handling.
Public Member Functions inherited from Graphics
 __construct ($options=array())
 graphics class constructor
 canRead ($ext)
 Checks if extension support reading file type.
 canWrite ($ext)
 Checks if extension supports writing file type.
 addBackground ($background)
 Background "action".
 addCrop ($width, $height, $x=0, $y=0)
 Adds crop action.
 addResize ($width, $height)
 Adds resize action.
 addThumb ($width, $height)
 Adds thumb action.
 addThumbfill ($width, $height, $centerX=50, $centerY=50)
 Adds thumb-fill action.
 renderFinished ()
 Called after rendering has finished.
 optimizeImage ($filename)
 Opimizes final image through one of the optimization programs.
 setQuality ($quality)
 Sets quality parameter.
 getPageNumber ()
 getPageNumber

Protected Member Functions

 crop ($width, $height, $x=0, $y=0)
 Crop action.
 resize ($width, $height)
 Resize action.
 thumb ($width, $height)
 Thumb action.
 thumbfill ($width, $height, $centerX=50, $centerY=50)
 Thumb-Fill action.
 load ()
 Loads image from file.
 save ()
 Saves image to file.
 getImageSize ()
 Determine size of input image.
Protected Member Functions inherited from Graphics
 escapeNumber ($number)
 Validates integers.
 dimensions ($width, $height)
 Scales image dimensions.
 processQueue ()
 Process action queue.
 lock ()
 lock
 unlock ()
 unlock
 obtainFormat ($fileName)
 Determines image format from file extension.
 getQuality ()
 Returns quality-index for current image format.
 bypassTest ($width, $height, $x=0, $y=0)
 Tests if action would change current image.
 bypass ()
 Runs bypass (copies file)

Protected Attributes

 $image
 Image resource identifier.
Protected Attributes inherited from Graphics
 $input
 Input filename.
 $output
 Output filename.
 $format
 Output format.
 $outputLockFp = null
 $otherRender = false
 otherRender is set to true if another render process has already locked file
 $queue = array()
 Action queue array.
 $size = array()
 Image size array(width, height)
 $background
 Image background string.
 $quality = ''
 Image quality string.
 $optimize
 Optimize output images.
 $optimizers
 List of optimizer binaries.
 $limits = []
 limits (mainly for imagemagick and graphicsmagick)
 $inputFormat
 Input image format.
 $outputFormat
 Output image format.
 $bypass = true
 Process bypass bool.

Additional Inherited Members

Static Public Member Functions inherited from Graphics
static factory ($options=array())
 graphics object factory
static which ($binary)
 Executes "which" command.

Member Function Documentation

◆ crop()

crop ( $width,
$height,
$x = 0,
$y = 0 )
protected

Applies crop action to $this->image.

Parameters
int$widthoutput width
int$heightoutput height
int$xcrop x-offset
int$ycrop y-offset
Returns
void

Definition at line 36 of file Gd.php.

◆ getImageSize()

getImageSize ( )
protected
Returns
void

Definition at line 207 of file Gd.php.

◆ load()

load ( )
protected

Determines image format and loads it to $this->image.

Returns
void

Definition at line 155 of file Gd.php.

◆ render()

render ( $input,
$output = null )

Starts actions, saves image, calls bypass if necessary.

Parameters
string$inputinput filename
string$outputoutput filename
Returns
void

Reimplemented from Graphics.

Definition at line 221 of file Gd.php.

◆ resize()

resize ( $width,
$height )
protected

Applies resize action to $this->image.

Parameters
int$widthoutput width
int$heightoutput height
Returns
void

Definition at line 65 of file Gd.php.

◆ save()

save ( )
protected

Adds background and saves $this->image to file.

Returns
void

Definition at line 180 of file Gd.php.

◆ thumb()

thumb ( $width,
$height )
protected

Applies thumb action to $this->image.

Parameters
int$widthoutput width
int$heightoutput height
Returns
void

Definition at line 86 of file Gd.php.

◆ thumbfill()

thumbfill ( $width,
$height,
$centerX = 50,
$centerY = 50 )
protected

Applies thumb-fill action to $this->image.

Parameters
int$widthoutput width
int$heightoutput height
int$centerXcenter of image from left in percent
int$centerYcenter of image from top in percent
Returns
void

Definition at line 121 of file Gd.php.

Field Documentation

◆ $image

$image
protected

Definition at line 23 of file Gd.php.


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