InputfieldImage class

One or more image uploads (sortable)

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

Show class?             Show args?        

Common

NameReturnSummary 
InputfieldImage::adminThumbScale int for backwards compatibility only 
InputfieldImage::clientQuality int Quality setting to use for client-side resize. 60=60%, 90=90%, etc. (default=90).  
InputfieldImage::dimensionsByAspectRatio bool int Switch min-/maxWidth and min-/maxHeight restriction for portrait images 
InputfieldImage::editFieldName string Field name to use for linking to image editor (default=current Inputfield name) 
InputfieldImage::extensions string Space separated list of allowed image extensions (default="JPG JPEG GIF PNG") 
InputfieldImage::focusMode string May be 'on', 'off', or 'zoom' 
InputfieldImage::get(string $key)
array bool mixed string nullGet setting or attribute 
InputfieldImage::getAdminThumb(Pageimage $img)
arrayGet thumbnail image info 
InputfieldImage::getConfigInputfields()
InputfieldWrapperConfigure field
InputfieldImage::gridMode string Default grid mode in admin, one of "grid", "left" or "list" (default="grid") 
InputfieldImage::gridSize int squared size of the admin thumbnails (default=130) 
InputfieldImage::imageSizerOptions array Options to pass along to the ImageSizer class. See /wire/config.php $imageSizerOptions for details. 
InputfieldImage::itemClass string Space separated CSS classes for items rendered by this Inputfield. Generally you should append rather than replace. 
InputfieldImage::maxHeight int string Max height for uploaded images, larger will be sized down (default='') 
InputfieldImage::maxReject bool int Reject images that exceed max allowed size? (default=false) 
InputfieldImage::maxSize float Maximum number of megapixels for client-side resize, i.e. 1.7 is ~1600x1000, alt. to maxWidth/maxHeight (default=0). 
InputfieldImage::maxWidth int string Max width for uploaded images, larger will be sized down (default='') 
InputfieldImage::minHeight int string Min height for uploaded images, smaller will be refused (default='') 
InputfieldImage::minWidth int string Min width for uploaded images, smaller will be refused (default='') 
InputfieldImage::okExtensions array Array of manually whitelisted extensions, for instance [ 'SVG' ] must be manually whitelisted if allowed. (default=[]) 
InputfieldImage::processInput(WireInputData $input)
$thisProcess input
InputfieldImage::render()
stringRender Inputfield
InputfieldImage::renderItem(Pageimage $pagefile, $id, $n)
string
InputfieldImage::renderList(Pageimages $value)
string
InputfieldImage::renderReady()
boolCalled right before Inputfield render 
InputfieldImage::renderSingleItem(Pageimage $pagefile, $id, $n)
string
InputfieldImage::renderUpload(Pageimages $value)
string
InputfieldImage::resizeServer int bool Resize to max width/height at server? 1=Server-only, 0=Use client-side resize when possible (default=0).  
InputfieldImage::useImageEditor int bool Whether or not the modal image editor is allowed for this field (default=true) 

For hooks

These methods are only useful for hooking and should not be called directly.

NameReturnSummary 
InputfieldImage::buildTooltipData($pagefile)
arrayBuild data for the tooltip that appears above the thumbnails
InputfieldImage::fileAdded(Pagefile $pagefile)
(nothing)Resize images to max width/height if specified in field config and image is larger than max
InputfieldImage::getFileActions(Pageimage $pagefile)
arrayGet array of actions (displayed in select dropdown) available for given Pagefile
InputfieldImage::getImageEditButtons($pagefile, string $id, int $n, string $buttonClass)
arrayGet array of buttons for image edit mode
InputfieldImage::getImageThumbnailActions(Pageimage $pagefile, string $id, int $n, string $class)
arrayGet the image thumbnail icon actions/links/buttons
InputfieldImage::processUnknownFileAction(Pageimage $pagefile, string $action, string $label)
bool nullCalled when a select dropdown action was received that InputfieldImage does not recognize (for hooking purposes)
InputfieldImage::renderAdditionalFields($pagefile, string $id, int $n)
(nothing)Render any additional fields (for hooks)
InputfieldImage::renderButtons($pagefile, string $id, int $n)
stringRender buttons for image edit mode

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #559
    The 559th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 25 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.