API Documentation for: 1.0.1
Show:

ImageUploader Class

Extends MediaUploader
Namespace: Canteen\Media

Class to upload images (JPEGs or PNGs only). Located in the namespace Canteen\Media.

Constructor

ImageUploader

(
  • inputName
  • uploadDir
  • [filename='']
)

Parameters:

  • inputName String

    The name of the input to check for

  • uploadDir String

    The upload direction location

  • [filename=''] String optional

    Optionally specify a filename

Item Index

Properties

Methods

createThumbnail

(
  • width
  • height
  • jpegQuality
  • [mode=ImageResizer::RESIZE_MAX_FILL_CROP]
  • [postfix='.tn']
)
Boolean

Create a thumbnail image

Parameters:

  • width Int

    The width of the thumbnail

  • height Int

    The height of the thumbnail

  • jpegQuality Int

    The jpeg compression quality from 0 to 100

  • [mode=ImageResizer::RESIZE_MAX_FILL_CROP] String optional

    The mode of the resize

  • [postfix='.tn'] String optional

    The string to affix to the end of the file name

Returns:

Boolean:

If the upload was successful

resize

(
  • width
  • height
  • [mode=ImageResizer::RESIZE_MAX_FILL_CROP]
)

Resize the image

Parameters:

  • width Int

    The width of the image

  • height Int

    The height of the image

  • [mode=ImageResizer::RESIZE_MAX_FILL_CROP] String optional

    The mode of the resize

Properties

thumbnailName

String

The name of the thumbnail