ImageInterface
interface ImageInterface implements ResourceBasedInterface (View source)
Interface of an Image
Constants
ORIENTATION_SQUARE |
|
ORIENTATION_LANDSCAPE |
|
ORIENTATION_PORTRAIT |
|
RATIOMODE_INSET |
Inset ratio mode: If an image is attempted to get scaled with the size of both edges stated, using this mode will scale it to the lower of both edges. Consider an image of 320/480 being scaled to 50/50: because aspect ratio wouldn't get hurt, the target image size will become 33/50. |
RATIOMODE_OUTBOUND |
Outbound ratio mode: If an image is attempted to get scaled with the size of both edges stated, using this mode will scale the image and crop it. Consider an image of 320/480 being scaled to 50/50: the image will be scaled to height 50, then centered and cropped so the width will also be 50. |
Methods
Refreshes this asset after the PersistentResource has been modified
Width of the image in pixels
Height of the image in pixels
Edge / aspect ratio of the image
Orientation of this image, i.e. portrait, landscape or square
Whether this image is square aspect ratio and therefore has a square orientation
Whether this image is in landscape orientation
Whether this image is in portrait orientation
Details
PersistentResource
getResource()
Returns the PersistentResource
void
refresh()
Refreshes this asset after the PersistentResource has been modified
int
getWidth()
Width of the image in pixels
int
getHeight()
Height of the image in pixels
float
getAspectRatio(bool $respectOrientation = false)
Edge / aspect ratio of the image
string
getOrientation()
Orientation of this image, i.e. portrait, landscape or square
bool
isOrientationSquare()
Whether this image is square aspect ratio and therefore has a square orientation
bool
isOrientationLandscape()
Whether this image is in landscape orientation
bool
isOrientationPortrait()
Whether this image is in portrait orientation