<?php /** * PhpThumb Library Example File * This file contains example usage for the PHP Thumb Library * PHP Version 5 with GD 2.0+ * PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com> * Copyright (c) 2009, Ian Selby/Gen X Design * * Author(s): Ian Selby <ian@gen-x-design.com> * * Licensed under the MIT License * Redistributions of files must retain the above copyright notice. * * @author Ian Selby <ian@gen-x-design.com> * @copyright Copyright (c) 2009 Gen X Design * @link http://phpthumb.gxdlabs.com * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @version 3.0 * @package PhpThumb * @subpackage Examples * @filesource */ require_once '../vendor/autoload.php'; $thumb = new PHPThumb\GD(__DIR__ .'/../tests/resources/test.jpg'); $thumb->adaptiveResize(175, 175); $thumb->show();
When developing a website with PHP, using object-oriented methods can indeed improve the code reuse rate and reduce code redundancy. What is more friendly to beginners is that most of the class libraries required for PHP website development are already available online. What I bring to you this time is a PHP class library for processing thumbnails. Friends who need it can use it directly.
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
13Jul2016
Sharing code for generating picture thumbnails in PHP based on GD2 graphics library. Code sharing for generating image thumbnails using PHP based on the GD2 graphics library. To use PHP to generate image thumbnails, make sure your PHP server has the GD2 graphics library installed. Use a class to generate image thumbnails.
25Jul2016
Code for php GD library to upload images and create thumbnails
12Jul2023
Detailed steps for image cutting using PHP and GD libraries. With the development of the Internet, image processing has become a very important task. Among them, picture cutting is a common requirement. You can divide a large picture into multiple small pictures, or splice a small picture into one large picture. This article will introduce the detailed steps of how to use PHP and GD library to implement image cutting, and give corresponding code examples. Preparation First, make sure your server has PHP and GD libraries installed. The GD library is a library for processing images. It can have many
13Jul2016
Sharing code for generating picture thumbnails in PHP based on GD2 graphics library. Code sharing for generating image thumbnails using PHP based on the GD2 graphics library. This article mainly introduces code sharing for generating image thumbnails using PHP based on the GD2 graphics library. This article directly gives the implementation code and
25Jul2016
Example of generating thumbnails with php GD library
Hot Tools
PHP multifunctional image processing class
PHP multifunctional image processing class
PHP library for creating animated GIFs
PHP library for creating animated GIFs