\JImage
Class to manipulate an image.
Synopsis
class JImage
{
- // constants
- const SCALE_FILL = 1;
- const SCALE_INSIDE = 2;
- const SCALE_OUTSIDE = 3;
- const CROP = 4;
- const CROP_RESIZE = 5;
- const SCALE_FIT = 6;
- // methods
- public void __construct()
- public static stdClass getImageFileProperties()
- public array generateThumbs()
- public array createThumbs()
- public JImage crop()
- public JImage filter()
- public integer getHeight()
- public integer getWidth()
- public string getPath()
- public boolean isLoaded()
- public bool isTransparent()
- public void loadFile()
- public JImage resize()
- public cropResize()
- public JImage rotate()
- public boolean toFile()
- protected JImageFilter getFilterInstance()
- protected stdClass prepareDimensions()
- protected integer sanitizeHeight()
- protected integer sanitizeOffset()
- protected integer sanitizeWidth()
- public boolean destroy()
- public void __destruct()
Hierarchy
Extended by
Constants
Name | Value |
---|---|
SCALE_FILL | 1 |
SCALE_INSIDE | 2 |
SCALE_OUTSIDE | 3 |
CROP | 4 |
CROP_RESIZE | 5 |
SCALE_FIT | 6 |
Members
protected
- $formats — array
- $handle — resource
- $path — string
Methods
protected
- getFilterInstance() — Method to get an image filter instance of a specified type.
- prepareDimensions() — Method to get the new dimensions for a resized image.
- sanitizeHeight() — Method to sanitize a height value.
- sanitizeOffset() — Method to sanitize an offset value like left or top.
- sanitizeWidth() — Method to sanitize a width value.
public
- __construct() — Class constructor.
- __destruct() — Method to call the destroy() method one last time to free any memory when the object is unset
- createThumbs() — Method to create thumbnails from the current image and save them to disk. It allows creation by resizing or croppping the original image.
- crop() — Method to crop the current image.
- cropResize() — Method to crop an image after resizing it to maintain proportions without having to do all the set up work.
- destroy() — Method to destroy an image handle and free the memory associated with the handle
- filter() — Method to apply a filter to the image by type. Two examples are: grayscale and sketchy.
- generateThumbs() — Method to generate thumbnails from the current image. It allows creation by resizing or cropping the original image.
- getHeight() — Method to get the height of the image in pixels.
- getImageFileProperties() — Method to return a properties object for an image given a filesystem path. The result object has values for image width, height, type, attributes, mime type, bits, and channels.
- getPath() — Method to return the path
- getWidth() — Method to get the width of the image in pixels.
- isLoaded() — Method to determine whether or not an image has been loaded into the object.
- isTransparent() — Method to determine whether or not the image has transparency.
- loadFile() — Method to load a file into the JImage object as the resource.
- resize() — Method to resize the current image.
- rotate() — Method to rotate the current image.
- toFile() — Method to write the current image out to a file.