ImageSizerEngine class

ImageSizer Engine Module (Abstract)

Copyright (C) 2016-2019 by Horst Nogajski and Ryan Cramer This file licensed under Mozilla Public License v2.0 2.0">http://mozilla.org/MPL/2.0


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ImageSizerEngine class also inherits all the methods and properties of: WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
ImageSizerEngine::convertToGreyscale()
bool

Convert image to greyscale

 
ImageSizerEngine::convertToSepia()
bool

Convert image to sepia

 
ImageSizerEngine::croppingValue($cropping)
string bool array

Given an unknown cropping value, return the validated internal representation of it

 
ImageSizerEngine::croppingValueStr($cropping)
string

Given an unknown cropping value, return the string representation of it

 
ImageSizerEngine::flipBoth()
bool

Flip both vertically and horizontally

 
ImageSizerEngine::flipHorizontal()
bool

Flip horizontally

 
ImageSizerEngine::flipVertical()
bool

Flip vertically

 
ImageSizerEngine::get(string $key)
mixed null

Get a property

 
ImageSizerEngine::getConfigData()
array

Get module config data

 
ImageSizerEngine::getEngineInfo()
array

Get array of information about this engine

 
ImageSizerEngine::getExtension()
string

Return the file extension

 
ImageSizerEngine::getFilename()
string

Return the filename

 
ImageSizerEngine::getHeight()
int

Return the image height

 
ImageSizerEngine::getImageType()
string null

Return the image type constant

 
ImageSizerEngine::getLibraryVersion()
string

Get library version string

 
ImageSizerEngine::getModified()
bool

Get whether the image was modified

 
ImageSizerEngine::getModuleConfigInputfields(InputfieldWrapper $inputfields)
None

Module configuration

 
ImageSizerEngine::getOptions()
array

Return an array of the current options

 
ImageSizerEngine::getSupportedFormats()
array

Get an array of image file formats this ImageSizerModule can use as source or target

 
ImageSizerEngine::getWidth()
int

Return the image width

 
ImageSizerEngine::isModified()
bool

Was the image modified?

 
ImageSizerEngine::prepare(string $filename)
None

Prepare the ImageSizer (this should be the first method you call)

 
ImageSizerEngine::resize(int $finalWidth, int $finalHeight)
bool

Resize the image

 
ImageSizerEngine::rotate(int $degrees)
bool

Just rotate image by number of degrees


Can also be used as property: ImageSizerEngine::rotate
 
ImageSizerEngine::setAutoRotation()
self

Turn on/off auto rotation

 
ImageSizerEngine::setConfigData(array $data)
None

Set module config data for ConfigurableModule interface

 
ImageSizerEngine::setCropExtra(array $value)
self

Set values for cropExtra rectangle, which enables cropping before resizing

 
ImageSizerEngine::setCropping()
self

Turn on/off cropping and/or set cropping direction

 
ImageSizerEngine::setDefaultGamma()
self

Set default gamma value: 0.5 - 4.0 | -1

 
ImageSizerEngine::setFlip($flip)
self

Set flip

 
ImageSizerEngine::setHidpi()
self

Enable hidpi mode?

 
ImageSizerEngine::setInterlace()
self

Turn on/off interlace

 
ImageSizerEngine::setModified(bool $modified)
self

Set whether the image was modified

 
ImageSizerEngine::setOptions(array $options)
self

Alternative to the above set* functions where you specify all in an array

 
ImageSizerEngine::setQuality(int $n)
self

Set the image quality 1-100, where 100 is highest quality

 
ImageSizerEngine::setRotate($degrees)
self

Set rotation degrees

 
ImageSizerEngine::setScale(float $scale)
self

Set scale for hidpi 2.0=hidpi, 1.0=normal, or other value if preferred)

 
ImageSizerEngine::setSharpening(mixed $value)
self

Set sharpening value: blank (for none), soft, medium, or strong

 
ImageSizerEngine::setTimeLimit()
self

Set a time limit for manipulating one image (default is 30)

 
ImageSizerEngine::setUpscaling()
self

Turn on/off upscaling

 
ImageSizerEngine::setUseUSM()
self

Toggle on/off the usage of USM algorithm for sharpening

 
ImageSizerEngine::setWebpAdd(bool $webpAdd)
self

Set flag to also create a webp file or not

 
ImageSizerEngine::setWebpOnly($value)
self

Set flag to only create a webp file

 
ImageSizerEngine::setWebpQuality(int $n)
self

Set the image quality 1-100 for WebP output, where 100 is highest quality

 
ImageSizerEngine::sharpeningValueStr($value)
string

Given an unknown sharpening value, return the string representation of it

 
ImageSizerEngine::supported()
bool

Is this ImageSizer class ready only means: does the server / system provide all Requirements!

 
ImageSizerEngine::writeBackIPTC(string $filename)
bool null

Default IPTC Handling

 

Properties

NameReturnSummary 
ImageSizerEngine::autoRotation bool 
ImageSizerEngine::cropping array string bool 
ImageSizerEngine::defaultGamma float 
ImageSizerEngine::enginePriority int Priority for use among other ImageSizerEngine modules (0=disabled, 1=first, 2=second, 3=and so on) 
ImageSizerEngine::flip string 
ImageSizerEngine::interlace bool 
ImageSizerEngine::quality int 
ImageSizerEngine::scale float 
ImageSizerEngine::sharpening string 
ImageSizerEngine::upscaling bool 
ImageSizerEngine::useUSM bool 
ImageSizerEngine::webpAdd bool 
ImageSizerEngine::webpOnly bool null 
ImageSizerEngine::webpQuality int 
ImageSizerEngine::webpResult bool null 

Additional methods and properties

In addition to the methods and properties above, ImageSizerEngine also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.253