This is a class that can process an image on the fly by either generate a thumbnail, apply an watermark to the image, or resize it.
Autodetect GD 1 and GD 2, auto-fitting, scaling, calculate quality factor for a specific file size, suport bicubic resample algorithm.
The processed image can either be displayed in a page, saved to a file, or returned to a variable.
It requires the PHP with support for GD library extension in either version 1 or 2. If the GD library version 2 is available it the class can manipulate the images in true color, thus providing better quality of the results of resized images.
Features description:
- Thumbnail: normal thumbnail generation
- Auto-fitting: adjust the dimensions so that the resized image aspect is not distorted
- Scaling: enlarge and shrink the image
- Format: both JPEG and PNG are supported, but the watermark image can only be in PNG format as it needs to be transparent
- Autodetect the GD library version supported by PHP
- Calculate quality factor for a specific file size in JPEG format.
- Suport bicubic resample algorithm
This is a class that generates thumbnail images on the fly. It may be useful for creating image galleries.
The thumbnails can be generated as the current script output or have its file data returned as a string.
The class supports caching the generated thumbnail images in server side files.
It requires the PHP GD extension. For remote files, url_allow_fopen must be set to on. If it is not, CURL is needed to access remote files.
Features Description:
- Cache
--> Thumbnails generated are cache-d so that you can access them faster should the content of the image not change
- Thumbnail
--> Standard thumbnail generation
- Auto-fitting
--> Need to fit an image within 300 by 300? Lazy to calculate the dimensions so that the image is not distorted? The class will do it for you!
- Scaling
--> Specify a scale to resize an image to! You can enlarge and shrink the image to as many times as you want!
This class can be used to generate image thumbnails.
It can use either the PHP GD library functions or the ImageMagick program.
The class generates thumbnail images with a size proportional to the original image.
If the original image is smaller than the target thumbnail size, the class may optionally enlarge the original image.
The empty spaces around the rescaled image can be optionally filled with a background color.
The rescaled image can be stored in a server side file or served as the current script output.
The class can store the thumbnail images in cache files to avoid thumbnail image generation overhead when the thumbnail images are generated with the same size.
When using GD library functions, the class checks the available memory to prevent thumbnail image generation errors.
When an error occurs, the class displays the error message within the generated image.
Generating thumbnail images with logo or watermark
These classes are meant to generate thumbnail images or adding a logo or watermark to a picture.
There are also sub-classes for caching the generated images in files stored in a temporary folder. The generated images may be cached to avoid the need to process the pictures during a given period of time.