|
| __construct ($filename, $newxsize=60, $newysize=60, $fileout='', $thumbMaxSize=0, $bgred=0, $bggreen=0, $bgblue=0) |
|
| check_jpeg ($f, $fix=false) |
|
class Image2Thumbnail Thumbnail creation with PHP4 and GDLib (recommended, but not mandatory: 2.0.1 !)
- Author
- Andreas Martens heyn@.nosp@m.plau.nosp@m.tdiet.nosp@m.sch..nosp@m.de
-
Patrick Teague webdu.nosp@m.de@v.nosp@m.eslac.nosp@m.h.co.nosp@m.m
-
Soeren Eberhardt <soeren|at|virtuemart.net>
- Version
- 1.0b
- Date
- modified 11/22/2004
- added support for GDLib < 2.0.1
- added support for reading gif images
- makes jpg thumbnails
- changed several groups of 'if' statements to single 'switch' statements
- commented out original code so modification could be identified.
Img2Thumb::__construct |
( |
|
$filename, |
|
|
|
$newxsize = 60 , |
|
|
|
$newysize = 60 , |
|
|
|
$fileout = '' , |
|
|
|
$thumbMaxSize = 0 , |
|
|
|
$bgred = 0 , |
|
|
|
$bggreen = 0 , |
|
|
|
$bgblue = 0 |
|
) |
| |
Constructor - requires following vars:
- Parameters
-
string | $filename | image path |
These are additional vars:
- Parameters
-
int | $newxsize | new maximum image width |
int | $newysize | new maximum image height |
string | $fileout | output image path |
int | $thumbMaxSize | whether thumbnail should have background fill to make it exactly $newxsize x $newysize |
int | $bgred | 0-255 - red color variable for background filler |
int | $bggreen | 0-255 - green color variable for background filler |
int | $bgblue | 0-255 - blue color variable for background filler |
Img2Thumb::check_jpeg |
( |
|
$f, |
|
|
|
$fix = false |
|
) |
| |
Img2Thumb::GetImgType |
( |
|
$filename | ) |
|
|
private |
private function - do not call
1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF
Img2Thumb::NewImgCreate |
( |
|
$filename, |
|
|
|
$newxsize, |
|
|
|
$newysize, |
|
|
|
$fileout |
|
) |
| |
|
private |
private function - do not call
Img2Thumb::NewImgResize |
( |
|
$orig_img, |
|
|
|
$newxsize, |
|
|
|
$newysize, |
|
|
|
$filename |
|
) |
| |
|
private |
/** Maybe adding sharpening with $sharpenMatrix = array ( array(-1.2, -1, -1.2), array(-1, 20, -1), array(-1.2, -1, -1.2) );
calculate the sharpen divisor $divisor = array_sum(array_map('array_sum', $sharpenMatrix));
$offset = 0;
apply the matrix imageconvolution($img, $sharpenMatrix, $divisor, $offset);
private function - do not call includes function ImageCreateTrueColor and ImageCopyResampled which are available only under GD 2.0.1 or higher !
Img2Thumb::NewImgSave |
( |
|
$new_img, |
|
|
|
$fileout, |
|
|
|
$type |
|
) |
| |
|
private |
private function - do not call
Img2Thumb::NewImgShow |
( |
|
$new_img, |
|
|
|
$type |
|
) |
| |
|
private |
private function - do not call
The documentation for this class was generated from the following file: