WOOF_Image :: resize( Arguments $args = array() )

Returns:

  • WOOF_Image An image object representing the resized image.

A highly useful method to resize an image, and cache the result in the image cache. Has the ability to crop, stretch, or fill the image to fit a certain width and height, or specify just a single dimension to resize the other dimension proportionally.

Example:

Parameters:

  • Arguments $args = array()

    An arguments array or string supporting the following parameters:

    • c => Whether the image should be cropped to fit the dimensions given (only applicable when BOTH dimensions are given). If you don’t crop, the image may contain whitespace to fill the shorter dimension. This can be either 0 (don’t crop), 1 (crop to trim where necessary), or 2 (crop WITHOUT rescaling to the height and width, but also trimmed of whitespace). default 1
    • w => The width to resize to – default 0 (i.e. unspecified)
    • h => The height to resize to – default 0 (i.e. unspecified)
    • q => The image quality to use for JPEG images – default 85
    • ca => The location to crop from (crop anchor) when cropping is required – default 0 (unspecified), but can be
      • L = Left (Middle)
      • TL = Top-Left
      • BL = Bottom-Left
      • R = Right (Middle)
      • TR = Top-Right
      • BR = Bottom-Right
      • T = Top (Center)
      • B = Bottom (Center)
      • C = Center
    • iar => whether to ignore the aspect ratio and simply squash or stretch the image, without cropping or whitespace – default 0 (false)
    • up => whether to allow UPsizing of an image – default 1 (true)
    • co => An x,y offset to the crop anchor. default “0,0”

Latest From the Blog

MasterPress 1.1.4 now available

MasterPress 1.1.4 is now available. This release contains an important compatibility fix for WordPress 4.5 to allow correct detection of the taxonomy term editing screen. Without this fix, any custom fields you have attached to custom taxonomies will not be shown at all in the editing form. Note also that MasterPress will still detect the edit screen correctly in… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 3.4, MySQL 5, and PHP version 5.2.4.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Traversal