|
| addFilter (callable $filter) |
|
| __construct ($filename) |
|
| imageCreateJpegfromExif ($filename) |
|
| save ($filename, $image_type=null, $quality=null, $permissions=null, $exact_size=false) |
|
| getImageAsString ($image_type=null, $quality=null) |
|
| __toString () |
|
| output ($image_type=null, $quality=null) |
|
| resizeToShortSide ($max_short, $allow_enlarge=false) |
|
| resizeToLongSide ($max_long, $allow_enlarge=false) |
|
| resizeToHeight ($height, $allow_enlarge=false) |
|
| resizeToWidth ($width, $allow_enlarge=false) |
|
| resizeToBestFit ($max_width, $max_height, $allow_enlarge=false) |
|
| scale ($scale) |
|
| resize ($width, $height, $allow_enlarge=false) |
|
| crop ($width, $height, $allow_enlarge=false, $position=self::CROPCENTER) |
|
| freecrop ($width, $height, $x=false, $y=false) |
|
| getSourceWidth () |
|
| getSourceHeight () |
|
| getDestWidth () |
|
| getDestHeight () |
|
| imageFlip ($image, $mode) |
|
| gamma ($enable=true) |
|
|
const | CROPTOP = 1 |
|
const | CROPCENTRE = 2 |
|
const | CROPCENTER = 2 |
|
const | CROPBOTTOM = 3 |
|
const | CROPLEFT = 4 |
|
const | CROPRIGHT = 5 |
|
const | CROPTOPCENTER = 6 |
|
const | IMG_FLIP_HORIZONTAL = 0 |
|
const | IMG_FLIP_VERTICAL = 1 |
|
const | IMG_FLIP_BOTH = 2 |
|
| $quality_jpg = 85 |
|
| $quality_webp = 85 |
|
| $quality_png = 6 |
|
| $quality_truecolor = true |
|
| $gamma_correct = true |
|
| $interlace = 1 |
|
| $source_type |
|
|
| $source_image |
|
| $original_w |
|
| $original_h |
|
| $dest_x = 0 |
|
| $dest_y = 0 |
|
| $source_x |
|
| $source_y |
|
| $dest_w |
|
| $dest_h |
|
| $source_w |
|
| $source_h |
|
| $source_info |
|
| $filters = array() |
|
◆ __construct()
Loads image source and its properties to the instanciated object
- Parameters
-
- Returns
- ImageResize
- Exceptions
-
◆ __toString()
Convert the image to string with the current settings
- Returns
- string
◆ addFilter()
addFilter |
( |
callable |
$filter | ) |
|
Add filter function for use right before save image to file.
- Parameters
-
- Returns
- $this
◆ applyFilter()
applyFilter |
( |
|
$image, |
|
|
|
$filterType = IMG_FILTER_NEGATE |
|
) |
| |
|
protected |
Apply filters.
- Parameters
-
$image | resource an image resource identifier |
$filterType | filter type and default value is IMG_FILTER_NEGATE |
◆ createFromString()
static createFromString |
( |
|
$image_data | ) |
|
|
static |
Create instance from a strng
- Parameters
-
- Returns
- ImageResize
- Exceptions
-
◆ crop()
crop |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$allow_enlarge = false , |
|
|
|
$position = self::CROPCENTER |
|
) |
| |
Crops image according to the given width, height and crop position
- Parameters
-
integer | $width | |
integer | $height | |
boolean | $allow_enlarge | |
integer | $position | |
- Returns
- static
◆ freecrop()
freecrop |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$x = false , |
|
|
|
$y = false |
|
) |
| |
Crops image according to the given width, height, x and y
- Parameters
-
integer | $width | |
integer | $height | |
integer | $x | |
integer | $y | |
- Returns
- static
◆ gamma()
Enable or not the gamma color correction on the image, enabled by default
- Parameters
-
- Returns
- static
◆ getCropPosition()
getCropPosition |
( |
|
$expectedSize, |
|
|
|
$position = self::CROPCENTER |
|
) |
| |
|
protected |
Gets crop position (X or Y) according to the given position
- Parameters
-
integer | $expectedSize | |
integer | $position | |
- Returns
- float|integer
◆ getDestHeight()
Gets height of the destination image
- Returns
- integer
◆ getDestWidth()
Gets width of the destination image
- Returns
- integer
◆ getImageAsString()
getImageAsString |
( |
|
$image_type = null , |
|
|
|
$quality = null |
|
) |
| |
Convert the image to string
- Parameters
-
int | $image_type | |
int | $quality | |
- Returns
- string
◆ getSourceHeight()
Gets source height
- Returns
- integer
◆ getSourceWidth()
Gets source width
- Returns
- integer
◆ imageFlip()
imageFlip |
( |
|
$image, |
|
|
|
$mode |
|
) |
| |
Flips an image using a given mode if PHP version is lower than 5.5
- Parameters
-
resource | $image | |
integer | $mode | |
- Returns
- null
◆ output()
output |
( |
|
$image_type = null , |
|
|
|
$quality = null |
|
) |
| |
Outputs image to browser
- Parameters
-
string | $image_type | |
integer | $quality | |
◆ resize()
resize |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image according to the given width and height
- Parameters
-
integer | $width | |
integer | $height | |
boolean | $allow_enlarge | |
- Returns
- static
◆ resizeToBestFit()
resizeToBestFit |
( |
|
$max_width, |
|
|
|
$max_height, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image to best fit inside the given dimensions
- Parameters
-
integer | $max_width | |
integer | $max_height | |
boolean | $allow_enlarge | |
- Returns
- static
◆ resizeToHeight()
resizeToHeight |
( |
|
$height, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image according to the given height (width proportional)
- Parameters
-
integer | $height | |
boolean | $allow_enlarge | |
- Returns
- static
◆ resizeToLongSide()
resizeToLongSide |
( |
|
$max_long, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image according to the given long side (short side proportional)
- Parameters
-
integer | $max_long | |
boolean | $allow_enlarge | |
- Returns
- static
◆ resizeToShortSide()
resizeToShortSide |
( |
|
$max_short, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image according to the given short side (short side proportional)
- Parameters
-
integer | $max_short | |
boolean | $allow_enlarge | |
- Returns
- static
◆ resizeToWidth()
resizeToWidth |
( |
|
$width, |
|
|
|
$allow_enlarge = false |
|
) |
| |
Resizes image according to the given width (height proportional)
- Parameters
-
integer | $width | |
boolean | $allow_enlarge | |
- Returns
- static
◆ save()
save |
( |
|
$filename, |
|
|
|
$image_type = null , |
|
|
|
$quality = null , |
|
|
|
$permissions = null , |
|
|
|
$exact_size = false |
|
) |
| |
Saves new image
- Parameters
-
string | $filename | |
integer | $image_type | |
integer | $quality | |
integer | $permissions | |
boolean | $exact_size | |
- Returns
- static
◆ scale()
Resizes image according to given scale (proportionally)
- Parameters
-
- Returns
- static
The documentation for this class was generated from the following file:
- source/classes/OssnImage.php