urvin / phikaru
PHP Hikaru image thumbnail server methods binding
dev-master
2019-08-04 20:15 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^8.1
This package is auto-updated.
Last update: 2025-03-10 16:09:59 UTC
README
PHP Hikaru image thumbnail server methods binding. Allows to operate with Hikaru image thumbnail server
Requirements
- PHP >= 7.1
Installation
composer require urvin/phikaru
Usage
// Create a phikaru object, define Hikaru URL and secret signature salt $phikaru = new \urvin\phikaru\Phikaru('http://hikaru.local', 'not_safe'); // Upload image $phikaru->upload('three_cows_walking_on_a_road', '/path/to/cows.jpg'); // Create a thumbnail URL as you want echo $phikaru->thumbnail() ->filename('three_cows_walking_on_a_road') ->extension('webp') ->width(600) ->height(600) ->cast(\urvin\phikaru\UrlBuilder::CAST_RESIZE_INVERSE) ->cast(\urvin\phikaru\UrlBuilder::CAST_TRIM) ->cast(\urvin\phikaru\UrlBuilder::CAST_EXTENT); // When a moment comes, delete source and all thumbnails from server $phikaru->remove('three_cows_walking_on_a_road');
Author
Yuriy Gorbachev yuriy@gorbachev.rocks
License
This module is licensed under the MIT license; see LICENSE