Images
in package
Table of Contents
Properties
- $timestamp : int
Methods
- Crop() : string
- Crop an image to a specific size.
- FinishUpload() : FinishUploadReply
- Finish the upload session returning the uploaded images.
- HasUpload() : bool
- Checks if the user has uploaded something in this session.
- ResizeHeight() : string
- Resize an image with a max height.
- ResizeMaxSize() : string
- Resize an image with a max width and max height.
- ResizeWidth() : string
- Resize an image with a max width.
- Serve() : string
- Serve an image with a default size.
- StartUpload() : StartUploadReply
- Start a new upload session filling the existing images.
- buildURL() : string
Properties
$timestamp
private
static int
$timestamp
Methods
Crop()
Crop an image to a specific size.
public
static Crop(string $image, int $width, int $height) : string
Parameters
- $image : string
-
Name of the image to serve.
- $width : int
-
Width of the image.
- $height : int
-
Height of the image.
Return values
string —URL to insert in the page.
FinishUpload()
Finish the upload session returning the uploaded images.
public
static FinishUpload() : FinishUploadReply
Return values
FinishUploadReply —Uploaded images and metadata.
HasUpload()
Checks if the user has uploaded something in this session.
public
static HasUpload() : bool
Return values
bool —True if the user has uploaded something that can be finished.
ResizeHeight()
Resize an image with a max height.
public
static ResizeHeight(string $image, int $maxHeight) : string
Parameters
- $image : string
-
Name of the image to serve.
- $maxHeight : int
-
Max height of the image.
Return values
string —URL to insert in the page.
ResizeMaxSize()
Resize an image with a max width and max height.
public
static ResizeMaxSize(string $image, int $maxWidth, int $maxHeight) : string
Parameters
- $image : string
-
Name of the image to serve.
- $maxWidth : int
-
Max width of the image.
- $maxHeight : int
-
Max height of the image.
Return values
string —URL to insert in the page.
ResizeWidth()
Resize an image with a max width.
public
static ResizeWidth(string $image, int $maxWidth) : string
Parameters
- $image : string
-
Name of the image to serve.
- $maxWidth : int
-
Max width of the image.
Return values
string —URL to insert in the page.
Serve()
Serve an image with a default size.
public
static Serve(string $image) : string
Parameters
- $image : string
-
Name of the image to serve.
Return values
string —URL to insert in the page.
StartUpload()
Start a new upload session filling the existing images.
public
static StartUpload(StartUploadRequest $req) : StartUploadReply
Parameters
- $req : StartUploadRequest
-
Request to start the session.
Return values
StartUploadReply —Session configuration to redirect to the external page.
buildURL()
private
static buildURL(string $image, int $width, int $height, bool $crop) : string
Parameters
- $image : string
- $width : int
- $height : int
- $crop : bool