urvin/phikaru

PHP Hikaru image thumbnail server methods binding

dev-master 2019-08-04 20:15 UTC

This package is auto-updated.

Last update: 2024-05-10 14:22:49 UTC


README

Latest Version on Packagist Software License Total Downloads

Build Status Coverage Status Quality Score

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