Download the PHP package townsymush/ewww-client without Composer

On this page you can find all versions of the php package townsymush/ewww-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ewww-client

Ewww.io Client

This client is a helper for using the ewww.io api for converting images to png, webp and optimising for use on the web.

To use ewww.io you require a api-key. Visit https://ewww.io to make an account

Please note that any functionality for ewww.io is entirely ewww.io's responsibility, this package is just a helper to use their API.

To install this package through composer

Usage

Create new instance of the converter The converter requires your api key as a string and a Guzzle Client to make the API requests

To convert/optimise and image you need to make a Job to process. There are two jobs WebPJob and FileJob

WebPJob

A WebPJob is used to convert an image (png, jpg) to a webp file.

Create job

If the file cannot be opened an exception will be thrown.

Set height and width (optional)

If you want to change height and width of image. You must set both on the job. The methods accept an integer which will set the image sizes in pixels

Set image quality (optional)

If you want to change the quality of the image set the quality with the following method. note the default is set at 82

FileJob

This job is used to optimise and image or convert a jpg or gif to png.

Create job

If the file cannot be opened an exception will be thrown.

Set image quality (optional)

If you want to change the quality of the image set the quality with the following method. note the default is set at 82 and this is only in effect is convert is set to true when processing PNG images.

Preserve metadata (optional)

To preserve metadata in the image file set the metadata to true. Note: Default is false

Lossy compression (optional) (Recommended)

To set lossy compression for higher compression with minimal quality loss Note: Default is false

Convert file (optional)

To convert the file type set this to true. It enables the conversion mode on the ewww.io API request (JPG to PNG, PNG to JPG or GIF to PNG)

Processing a job example

Once a job has been created, the next step is to process that job with the converter.

Worth noting

Unfortunately the ewww.io API does not return error status codes which could make the client throw an exception. If the api request failed you will need to inspect the response for the error message.

We are assuming that you will have validated your image before sending it through the ewww.io api. This package does not validate the image types being processed.

Tests

We have written some tests as part of this package which you can run by running ./vendor/bin/phpunit while in the project directory. You will need o add your api-key to the tests and remember this will use some of your pre-paid credits on your ewww.io account.


All versions of ewww-client with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version 6.*
php Version >=7.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package townsymush/ewww-client contains the following files

Loading the files please wait ....