thayllonvictor/phpthumb

A simple class that uses the gd lib to cut and create thumbnails from images.

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/thayllonvictor/phpthumb

v1.0.0 2023-11-14 13:44 UTC

This package is auto-updated.

Last update: 2025-12-14 18:07:44 UTC


README

A simple class that uses the gd lib to cut and create thumbnails from images.

Installation

composer require thayllonvictor/phpthumb

Usage

// Create class PHPThumb
$phpThumb = new PHPThumb();

// Set file imagem: upload file or path file
$phpThumb->loadImage('example.jpg');

// Set width your thumbnail
$phpThumb->thumbWidth('100');

// Set height yout thumbnail
$phpThumb->thumbHeight('100');

// Set name image with a extension 
$phpThumb->setFileName('new-thumnail.png');

// Set dir save
$phpThumb->savePath('thumbs/');

// Generate thumbnail
$phpThumb->generateThumb();