ImageUtility Class Reference
|
Public Member Functions |
| | readImage ($filename) |
| | writeImage ($img, $type, $filename) |
| | makeThumbnail ($image, $width, $height) |
| | makeThumbnailProportional ($image, $max_x, $max_y) |
| | isImageInvalid ($filename, $maxwidth, $maxheight, $minwidth=1, $minheight=1) |
| | simpleUploadError ($fieldname) |
| | getNudity ($img, $colorA=0x793B24, $colorB=0xFEC5BF) |
Data Fields |
| const | IMGERR_TOOBIG = 1 |
| const | IMGERR_TOOSMALL = 2 |
| const | IMGERR_UNKNOWNFORMAT = 4 |
| const | UPL_TOOBIG = 1 |
| const | UPL_INTERNAL = 2 |
| const | UPL_EXTENSION = 3 |
Detailed Description
Definition at line 21 of file imageutility.php.
Member Function Documentation
| getNudity |
( |
$ |
img, |
|
|
$ |
colorA = 0x793B24, |
|
|
$ |
colorB = 0xFEC5BF | |
|
) |
| | |
try to classify how likely the picture contains nudity. warning: O(scary) (read: can take several seconds depending for big pictures)
- Parameters:
-
| resource | $img image-resource of the picture to classify |
- Returns:
- float 0=no nudity 100=full frontal nudity ^^
Definition at line 210 of file imageutility.php.
| isImageInvalid |
( |
$ |
filename, |
|
|
$ |
maxwidth, |
|
|
$ |
maxheight, |
|
|
$ |
minwidth = 1, |
|
|
$ |
minheight = 1 | |
|
) |
| | |
| makeThumbnail |
( |
$ |
image, |
|
|
$ |
width, |
|
|
$ |
height | |
|
) |
| | |
simply create a thumbnail, dont make it proportional
- Parameters:
-
| image | $image |
| int | $width |
| int | $height |
Definition at line 86 of file imageutility.php.
| makeThumbnailProportional |
( |
$ |
image, |
|
|
$ |
max_x, |
|
|
$ |
max_y | |
|
) |
| | |
enshure picture fits proportionally into the destionation size. this could possibly result in the picture being cropped
- Parameters:
-
| image | $image |
| int | $max_x target width |
| int | $max_y target height |
Definition at line 99 of file imageutility.php.
read a gif,jpg,png from disk and return image
- Parameters:
-
- Returns:
- image
Definition at line 36 of file imageutility.php.
| simpleUploadError |
( |
$ |
fieldname |
) |
|
reduce several upload-errors to 3 general ones
- Parameters:
-
| string | $fieldname name="" of the upload-input-element |
- Returns:
- mixed true=success, false=no file given, UPLOAD_ERR_
Definition at line 172 of file imageutility.php.
References UPL_EXTENSION, UPL_INTERNAL, and UPL_TOOBIG.
| writeImage |
( |
$ |
img, |
|
|
$ |
type, |
|
|
$ |
filename | |
|
) |
| | |
write the given image to disk
- Parameters:
-
| image | $img |
| int | $type imagetype, IMAGETYPE_GIF usw. |
| string | $filename |
Definition at line 64 of file imageutility.php.
Field Documentation
The documentation for this class was generated from the following file: