ksubileau / color-thief-php

Grabs the dominant color or a representative color palette from an image. Uses PHP and GD, Imagick or Gmagick.
MIT License
633 stars 64 forks source link

How can I can install without composer? #29

Closed Nullmegh closed 7 years ago

ksubileau commented 8 years ago

You have to require each PHP files present under the lib folder, one by one. The order is important, but I don't know it, sorry. You have to proceed by trial/error to find it.

Otherwise, you can write a PSR-0 autoloader to replace the one provided by Composer. See also this thread on StackOverflow.

Nullmegh commented 8 years ago

oh okay damm it xD

leehoss commented 7 years ago

Here you go.... just change the required image adapter you are using

require_once 'lib/ColorThief/ColorThief.php' ;
require_once 'lib/ColorThief/VBox.php' ;
require_once 'lib/ColorThief/PQueue.php' ;
require_once 'lib/ColorThief/CMap.php' ;

require_once 'lib/ColorThief/Image/ImageLoader.php' ;

require_once 'lib/ColorThief/Image/Adapter/IImageAdapter.php' ;
require_once 'lib/ColorThief/Image/Adapter/ImageAdapter.php' ;
require_once 'lib/ColorThief/Image/Adapter/ImagickImageAdapter.php' ;
ksubileau commented 6 years ago

You can also use any existing PSR-4 autoloader or implement your custom one. See https://www.php-fig.org/psr/psr-4/.