Home >Backend Development >PHP Tutorial >What does thumbs mean? PHPThumb PHP Image Thumbnail Gallery
1. This is a thumbnail class library
It is an open source picture thumbnail class library that can complete a variety of complex picture thumbnail generation and reality, and is very convenient to use.
2. Usage
Here is a simple and practical explanation about it. The English is relatively simple and will not be translated:
Basic-Usage
3. API
Here is a list of APIs:
PHPThumb API
But it is a pity that in the API There is no explanation. You can only guess its effect based on its English name. Of course, even if you guess it right, you have to test it to see if it is correct.
4. Example
Here I also wrote a simple method to call it, but I saved the image as a file. The examples in basic-usage are all output directly on the page:
Copy the code The code is as follows:
require_once 'phpthumb/ThumbLib.inc.php';
try {
$thumb = PhpThumbFactory::create($realpath);
} catch (Exception $e) {
// handle error here however you'd like
}
$thumb->adaptiveResize($width, $height);
$thumb->save($realpath . '.' . $width . 'x' . $height . '.png ');
The above has introduced what thumbs means. PHPThumb PHP picture thumbnail gallery, including what thumbs means. I hope it will be helpful to friends who are interested in PHP tutorials.