# Models

::TODO:: Rewrite for interface

# CraftTransformedImageModel

The model returned by the craft.imager.transformImage method.

# Public attributes

url: URL to the image.
path: System path to the image file.
extension: File extension.
mimeType: File mime type.
width: Width of the image.
height: Height of the image.
size: Size of the image in bytes.

# Public methods

getUrl() [string]
URL to the image.

getPath() [string]
System path to the image file.

getExtension() [string]
File extension.

getMimeType() [string]
File mime type.

getWidth() [string]
Width of the image.

getHeight() [string]
Height of the image.

getSize($unit='b', $precision='2') [float]
Size of the image. Example:

{{ image.getSize() }} B 
{{ image.getSize('k') }} KB 
{{ image.getSize('m', 10) }} MB 
{{ image.getSize('g', 10) }} GB

getDataUri() [string]
Returns a data uri with the image base64 encoded as a string.

getBase64Encoded() [string]
Returns a string of the base64 encoded image data.


# ImgixTransformedImageModel

The model returned by the craft.imager.transformImage method if Imgix is enabled. This model has the same signature as the CraftTransformedImageModel for compabilities sake, but does return empty strings for some of its attributes that are not applicable, or not possible to determine.

# Public attributes

url: URL to the image.
path: Returns an empty string.
extension: Returns an empty string.
mimeType: Returns an empty string.
width: Width of the image.
height: Height of the image.
size: Returns an empty string.

# Public methods

getUrl() [string]
URL to the image.

getPath() [string]
Returns an empty string.

getExtension() [string]
Returns an empty string.

getMimeType() [string]
Returns an empty string.

getWidth() [string]
Width of the image.

getHeight() [string]
Height of the image.

getSize($unit='b', $precision='2') [float]
Returns an empty string.

getDataUri() [string]
Returns an empty string.

getBase64Encoded() [string]
Returns an empty string.