PHP Classes

PHP Image Optimizer: Optimize images adjusting the size and quality

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 121 All time: 9,494 This week: 51Up
Version License PHP version Categories
imageoptimzer 1.0Freeware5PHP 5, Graphics, Compression
Description 

Author

This package can optimize images by adjusting the size and quality.

It can load and regenerate an uploaded image file with a given width or height limit and quality level that determines the image compression factor.

The regenerated images can be downloaded in PNG format with a given name.

Picture of Martijn Waeyenbergh
  Performance   Level  
Name: Martijn Waeyenbergh <contact>
Classes: 7 packages by
Country: Belgium Belgium
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Example

<?php

require("imageOptimzer.php");

if(isset(
$_POST['optimizePhoto'])){
   
$testImage = new imageOptimzer($_FILES["file"],$_POST['maxWidth'],$_POST['maxHeight'],$_POST['quality']);
}



?>

<h1>Upload an image (jpg/gif/png) and get an optimzed PNG version</h1>
<form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
    <label for="uitleg" class="control-label">Upload a picture to Optimize</label><br><br>
    max. width: <input type="number" value='1000' name='maxWidth'><br>
    max. height: <input type="number" value='1000' name='maxHeight'><br>
    Quality (0-9): <input type="number" value='9' min=0 max=9 name='quality'><br>
    <input type="file" name="file" id="file"><br><br>
    <input type="submit" name="optimizePhoto" class="btn btn-primary" value="Optimize!">
</form>


  Files folder image Files (2)  
File Role Description
Plain text file imageOptimzer.php Class imageOptimzer.php
Accessible without login Plain text file test.php Example a test file (form to upload image) and set the settings

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:121
This week:0
All time:9,494
This week:51Up