ice framework documentation ice doc v1.6.2
Methods
  • __construct(string $file) : void
    Run install check and load the image.
  • check() : bool
    Checks if GD is enabled and bundled. Bundled GD is required for some methods to work.
  • __destruct() : void
    Destroys the loaded image to free up resources.
  • loadImage() : void
    Loads an image into GD.
  • doResize(int $width, int $height) : void
    Execute a resize.
  • doCrop(int $width, int $height, int $offsetX, int $offsetY) : void
    Execute a crop.
  • doRotate(int $degrees) : void
    Execute a rotation.
  • doFlip(int $direction) : void
    Execute a flip.
  • doSharpen(int $amount) : void
    Execute a sharpen.
  • doReflection(int $height, int $opacity, bool $fadeIn) : void
    Execute a reflection.
  • doWatermark(variable $watermark, int $offsetX, int $offsetY, int $opacity) : void
    Execute a watermarking.
  • doBackground(int $r, int $g, int $b, int $opacity) : void
    Execute a background.
  • doSave(string $file, variable $quality) : bool
    Execute a save.
  • doRender(string $type, variable $quality) : string
    Execute a render.
  • saveFunction(string $extension, int $quality) : array
    Get the GD saving function and image type for this extension.
  • create(int $width, int $height) : resource
    Create an empty image with the given width and height.
Methods Details
  • public function __construct(string $file)

    Run install check and load the image.
  • public static function check()

    Checks if GD is enabled and bundled. Bundled GD is required for some methods to work.
    Exceptions will be thrown from those methods when GD is not bundled.
  • public function __destruct()

    Destroys the loaded image to free up resources.
  • protected function loadImage()

    Loads an image into GD.
  • protected function doResize(int $width, int $height)

    Execute a resize.
  • protected function doCrop(int $width, int $height, int $offsetX, int $offsetY)

    Execute a crop.
  • protected function doRotate(int $degrees)

    Execute a rotation.
  • protected function doFlip(int $direction)

    Execute a flip.
  • protected function doSharpen(int $amount)

    Execute a sharpen.
  • protected function doReflection(int $height, int $opacity, bool $fadeIn)

    Execute a reflection.
  • protected function doWatermark(variable $watermark, int $offsetX, int $offsetY, int $opacity)

    Execute a watermarking.
  • protected function doBackground(int $r, int $g, int $b, int $opacity)

    Execute a background.
  • protected function doSave(string $file, variable $quality)

    Execute a save.
  • protected function doRender(string $type, variable $quality)

    Execute a render.
  • protected function saveFunction(string $extension, int $quality)

    Get the GD saving function and image type for this extension.
    Also normalizes the quality setting
  • protected function create(int $width, int $height)

    Create an empty image with the given width and height.