<?php use PHPImageWorkshop\ImageWorkshop as ImageWorkshop; require_once(__DIR__.'/autoload.php'); class ImageWorkshopTest extends \PHPUnit_Framework_TestCase { =================================================================================== const IMAGE_SAMPLE_PATH = '/Resources/images/sample1.jpg'; const FONT_SAMPLE_PATH = '/Resources/fonts/arial.ttf'; const WEB_PATH = 'http://localhost:8000'; public function testInitFromPath() { // test 1 $layer = ImageWorkshop::initFromPath(__DIR__.static::IMAGE_SAMPLE_PATH); $this->assertTrue(is_object($layer) === true, 'Expect $layer to be an object'); $this->assertTrue(get_class($layer) === 'PHPImageWorkshop\Core\ImageWorkshopLayer', 'Expect $layer to be an ImageWorkshopLayer object'); // test 2 $layer = ImageWorkshop::initFromPath('file://'.__DIR__.static::IMAGE_SAMPLE_PATH); $this->assertTrue(is_object($layer) === true, 'Expect $layer to be an object'); $this->assertTrue(get_class($layer) === 'PHPImageWorkshop\Core\ImageWorkshopLayer', 'Expect $layer to be an ImageWorkshopLayer object'); // test 3 if (version_compare(PHP_VERSION, '5.4', '>=')) { $layer = ImageWorkshop::initFromPath(static::WEB_PATH.'/sample1.jpg'); $this->assertTrue(is_object($layer) === true, 'Expect $layer to be an object'); $this->assertTrue(get_class($layer) === 'PHPImageWorkshop\Core\ImageWorkshopLayer', 'Expect $layer to be an ImageWorkshopLayer object'); }
The advantages of this library.
The thumbnail speed is very fast and the quality is very high
Support smart cropping
Very good support for GIF images
5 thumbnail modes
Image comparison function
Advanced image filtering function
Image blending
The APIs supported by other image processing libraries are basically supported
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
30Oct2024
Native Java Image Processing Libraries for High-Quality ResultsAs you have encountered limitations with ImageMagick and JAI, let's explore other...
28Oct2024
Optimizing Java Image Processing: Comparing Libraries and ApproachesDespite utilizing both JAI media APIs and ImageMagick, a developer encounters...
31Oct2024
Java Image Processing Library OptionsIn exploring Java image processing, you may have encountered limitations with both JAI media APIs and...
12Jul2016
PHP image processing, php image processing. PHP image processing, php image processing PHP provides some functions for editing and processing images. The most typical applications are random graphic verification codes, image watermarks and data statistics.
29Dec2024
Pixel Color Modification in Go Image ProcessingChallenge:Manipulating a JPEG image by modifying the color of specific pixels necessitates...
05Jan2025
PHP ORM Library RecommendationsWhen it comes to object-relational mapping (ORM) for PHP, there are several libraries that stand out. To address...
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images