This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Helper_Image

Direct known subclasses


Package: Helpers
Copyright: Copyright (c) 2003-2008 Concrete5. (
License: MIT License
Author: Andrew Embler
Located at core/helpers/image.php

Methods summary

# reset( )

Resets the compression level to the system default This method is automatically run when Loader::helper invokes this class

public integer
# defaultJpegCompression( )

Returns the default system value for JPEG image compression

public Concrete5_Helper_Image
# setJpegCompression( integer $level )

Overrides the default or defined JPEG compression level per instance of the image helper. This allows for a single-use for a particularly low or high compression value. Passing a non-integer value will reset to the default system setting (DEFINE or 80)

public boolean
# create( string $originalPath, string $newPath, integer $width, integer $height, boolean $crop = false )

Creates a new image given an original path, a new path, a target width and height. Optionally crops image to exactly match given width and height.

# getThumbnail( mixed $obj, integer $maxWidth, integer $maxHeight, boolean $crop = false )

Returns a path to the specified item, resized and/or cropped to meet max width and height. $obj can either be a string (path) or a file object. Returns an object with the following properties: src, width, height

# outputThumbnail( $obj, $maxWidth, $maxHeight, $alt = null, $return = false, $crop = false )

Runs getThumbnail on the path, and then prints it out as an XHTML image

# output( $obj, $alt = null, $return = false )

Properties summary

public integer $jpegCompression
# 80