Class: Image

Image-manipulation methods.

Properties

No properties.

Methods

public static resize ($file, $width = 140, $height = 105, $style = 'cover', $format = 'ext')

If it can, it creates a cached thumbnail of the specified image file, saved to cache/thumbs with the name md5($file) plus -WIDTHxHEIGHT.jpg. If it can't create the thumbnail, the original will be returned with one of the following messages added to it as a hashmark:

#gd-missing
#libjpg-missing
#libpng-missing
#libgif-missing
#unsupported-format

If the cached version already exists, and its modification time is newer than the original, then the cached version is returned immediately.

This makes first requests to a gallery page expensive, but subsequent requests much faster.

public static reorient ($file)

Fixes the orientation of a JPEG image based on its exif data. Note: Requires the exif PHP extension, or it will simply return the original image untouched with the following hashmark added: #exif-missing.

public static generate_key ($key)

Generate a unique key for embedded image spots.

public static for_key ($key, $image)

Get or set the image associated with a key.