PHP Classes

PHP Image Optimizer: Optimize images adjusting the size and quality

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 119 All time: 9,508 This week: 524Up
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
Age: 44
All time rank: 311617 in Belgium Belgium
Week rank: 298 Up3 in Belgium Belgium Up
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  
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

 Version Control Unique User Downloads Download Rankings  
 0%
Total:119
This week:0
All time:9,508
This week:524Up