PHP Classes

Simple PHP Image Resize: Create thumbnails of images in a given directory

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 enough user ratingsTotal: 229 All time: 8,173 This week: 524Up
Version License PHP version Categories
simple-image-resize 1.0Q Public License ...5.0PHP 5, Graphics
Description 

Author

This class can create thumbnails of images in a given directory.

It can traverse a given directory to find image files with given file name extensions.

The class can create thumbnail images with a given width or height limit and store them in a given separate directory.

Picture of Marcus Brasizza
  Performance   Level  
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

 

Example

<?php
$tam
= '240';
$path = '/opt/images/toop/big/darkness.jpg';
$path_dest = '/opt/images/toop/resized/';

/*BUILD THE OBJECT */

$red = new Redimensionar;
$red->AdicionaTamanho($tam); // adiciona o primeiro tamanho pra fazer a proporção
$red->AdicionaExtensoes('jpeg'); // adiciona uma extensão pra procurar arquivos pra redimensionar
$red->AdicionaExtensoes('jpg'); // adiciona uma extensão pra procurar arquivos pra redimensionar
$red->__set('ArqOrigem',$path); // adiciona um diretório de onde está o arquivo pra conversão
$red->__set('DirDestino',$path_dest); // adiciona um diretório de onde será colocado os arquivos
$convertidos = $red->executar();

echo
"<pre>";
print_r($convertidos);
echo
"</pre>";
?>


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file usage.php Example Usage file
Plain text file Redimensionar.php Class core file

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:229
This week:0
All time:8,173
This week:524Up