# ImageGd

class ImageGd extends Image

## Constants

BRANDING_TOP |
BRANDING_TOP_RIGHT |
BRANDING_RIGHT |
BRANDING_BOTTOM_RIGHT |
BRANDING_BOTTOM |
BRANDING_BOTTOM_LEFT |
BRANDING_LEFT |
BRANDING_TOP_LEFT |
BRANDING_CENTER |

## Properties

protected | $_image |  | from Image
protected | $_isResized |  | from Image
protected | $_isBranded |  | from Image
| $name |  | from Image
| $path |  | from Image
| $extension |  | from Image
| $filepath |  | from Image
| $imageinfos |  | from Image
| $newWidth |  | from Image
| $newHeight |  | from Image
| $mainWidth |  | from Image
| $mainHeight |  | from Image
| $quality |  | from Image

## Methods

__construct($filepath)

No description

multitype:number
_calcWatermarkPosition(int $image_width, int $image_height, int $watermark_width, int $watermark_height, int $position, int $padding)

Calculates the Watermark position

from Image
multitype:number
_calcWatermarkOffset(int $image_width, int $image_height, int $watermark_width, int $watermark_height, int $percent = 30)

Calculates the Watermark offset

from Image
__destruct()

No description

resize(int $width, int $height, boolean $useContainer = false, string $backgroundColor = null, int $quality = 80)

(non-PHPdoc)

watermark(string $filepath, int $position, int $percent = null, float $opacity = 1.0, int $padding)

(non-PHPdoc)

save(string $newFilepath)

(non-PHPdoc)

destroy()

(non-PHPdoc)

_imageload_alpha($width, $height, $backgroundColor, $filepath = null)

No description

_imageload_container($width, $height, $containerWidth, $containerHeight, $backgroundColor, $filepath = null)

No description

_imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct)

No description

_createImage($filepath = null)

No description

_html2rgb($color)

No description

## Details

###
at line 13
`__construct($filepath)`

#### Parameters

| $filepath |

###
in Image at line 74
`protected multitype:number _calcWatermarkPosition(int $image_width, int $image_height, int $watermark_width, int $watermark_height, int $position, int $padding)`

Calculates the Watermark position

#### Parameters

int | $image_width |
int | $image_height |
int | $watermark_width |
int | $watermark_height |
int | $position |
int | $padding |

#### Return Value

multitype:number |

###
in Image at line 135
`protected multitype:number _calcWatermarkOffset(int $image_width, int $image_height, int $watermark_width, int $watermark_height, int $percent = 30)`

Calculates the Watermark offset

#### Parameters

int | $image_width |
int | $image_height |
int | $watermark_width |
int | $watermark_height |
int | $percent |

#### Return Value

multitype:number |

###
at line 20
`__destruct()`

###
at line 31
`resize(int $width, int $height, boolean $useContainer = false, string $backgroundColor = null, int $quality = 80)`

(non-PHPdoc)

#### Parameters

int | $width |
int | $height |
boolean | $useContainer |
string | $backgroundColor |
int | $quality |

#### See also

\jtl\Connector\Core\Drawing\IDrawing::resize() |

###
at line 63
`watermark(string $filepath, int $position, int $percent = null, float $opacity = 1.0, int $padding)`

(non-PHPdoc)

#### Parameters

string | $filepath |
int | $position |
int | $percent |
float | $opacity |
int | $padding |

#### See also

\jtl\Connector\Core\Drawing\IDrawing::watermark() |

###
at line 109
`save(string $newFilepath)`

(non-PHPdoc)

#### Parameters

string | $newFilepath |

#### See also

\jtl\Connector\Core\Drawing\IDrawing::save() |

###
at line 153
`destroy()`

(non-PHPdoc)

#### See also

\jtl\Connector\Core\Drawing\IDrawing::destroy() |

###
at line 158
`protected _imageload_alpha($width, $height, $backgroundColor, $filepath = null)`

#### Parameters

| $width |
| $height |
| $backgroundColor |
| $filepath |

###
at line 204
`protected _imageload_container($width, $height, $containerWidth, $containerHeight, $backgroundColor, $filepath = null)`

#### Parameters

| $width |
| $height |
| $containerWidth |
| $containerHeight |
| $backgroundColor |
| $filepath |

###
at line 257
`protected _imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct)`

#### Parameters

| $dst_im |
| $src_im |
| $dst_x |
| $dst_y |
| $src_x |
| $src_y |
| $src_w |
| $src_h |
| $pct |

###
at line 293
`protected _createImage($filepath = null)`

#### Parameters

| $filepath |

###
at line 320
`protected _html2rgb($color)`

#### Parameters

| $color |