Handles scaling and image loading. More...
Go to the source code of this file.
Functions | |
loadImage ($path) | |
resizeImage ($path, $width, $height) | |
saveImage ($img, $path, $extension, $quality=100) | |
Variables | |
$absPath = str_replace('\\','/',realpath(dirname(__FILE__))).'/' | |
used to get absolute path to the script root More... | |
const | ABS_PATH $absPath |
absolute path to the script root More... | |
const | NO_PREVIEW 'inc/img/no_preview.png' |
image to load on error More... | |
$maxHeight = (isset($_GET['max_height']) && ctype_digit($_GET['max_height'])) ? $_GET['max_height'] : 60 | |
holds maximum height More... | |
$maxWidth = (isset($_GET['max_width']) && ctype_digit($_GET['max_width'])) ? $_GET['max_width'] : 120 | |
holds maximum width More... | |
$filename = $_GET['file'] | |
holds file to load More... | |
Handles scaling and image loading.
To specify the image to load use http get var 'file'. To specify the maximum height and maximum width use http get vars 'max_height' and 'max_width'. Scaled photos are stored in a subfolder '_scaled' for further use. Output format is png.
Definition in file img.php.
loadImage | ( | $path) |
Loads image depending on the type
string | $path | path to the image |
Definition at line 39 of file img.php.
Referenced by resizeImage().
resizeImage | ( | $path, | |
$width, | |||
$height | |||
) |
Resize image depending on the type (and handle transparancy)
string | $path | path to the image |
integer | $width | maximum width for scaled image |
integer | $height | maximum height for scaled image |
Definition at line 71 of file img.php.
References $height, $width, and loadImage().
saveImage | ( | $img, | |
$path, | |||
$extension, | |||
$quality = 100 |
|||
) |
Save image depending on the type
mixed | $img | image ressource |
string | $path | path for saving (including filename and extension) |
integer | $extension |
|
integer | $quality | [optional]
|
$absPath = str_replace('\\','/',realpath(dirname(__FILE__))).'/' |
$filename = $_GET['file'] |
holds file to load
Definition at line 157 of file img.php.
Referenced by fetchSponsorCarAttachments(), and hasSecurityHeader().
$maxHeight = (isset($_GET['max_height']) && ctype_digit($_GET['max_height'])) ? $_GET['max_height'] : 60 |
$maxWidth = (isset($_GET['max_width']) && ctype_digit($_GET['max_width'])) ? $_GET['max_width'] : 120 |