lorddashme/php-image-squeezer

A simple PHP package for image compression powered by FFMPEG.

1.0.0 2019-02-15 09:54 UTC

This package is auto-updated.

Last update: 2024-10-30 02:04:58 UTC


README

A simple PHP package for image compression powered by FFMPEG.

Latest Stable Version Minimum PHP Version Coverage Status

Requirement(s)

  • PHP version from 5.4.* up to latest.

  • Operating System: Windows, Linux or Mac OS X.

Install

via Composer

  • Use the command below to install the package via composer:
composer require lorddashme/php-image-squeezer

Usage

  • Below are the simple implementation of the package:
<?php

include __DIR__  . '/vendor/autoload.php';

// Import the main class of the PHP Image Squeezer.
use LordDashMe\ImageSqueezer\ImageSqueezer;

// Initialize the main class.
$imageSqueezer = new ImageSqueezer();

// Load the necessary requirements and validate
// if the package fit for the current environment.
$imageSqueezer->load();

// Provide the source file path of the desire image
// that will be compress later on.
$imageSqueezer->setSourceFilePath('/path/source-filename');

// Provide the output file path of the compressed image.
$imageSqueezer->setOutputFilePath('/path/output-filename');

// Execute the image compression.
$imageSqueezer->compress();

License

This package is open-sourced software licensed under the MIT license.