Skip to content

artem-popov/thumb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thumb

Mini library for creating thumbs.

1. Getting started

The library allows you to resize images by setting either the width or the height of the resulting thumb. The other dimension will be determined authomatically to preserve the ratio.

use \thumb\Thumb;

$img = new Thumb("image.jpg");

/** 
 * The following will create thumbsFolder/image.jpg
 * with a width of 300 and a proportional height.
 */
$img->create(300, "thumbsFolder");

/** 
 * The following will create thumbsFolder/thumbName.jpg
 * with a width of 300 and a proportional height.
 */
$img->create(300, "thumbsFolder", "thumbName.jpg", Thumb::WIDTH);

/** 
 * The following will create thumbsFolder/thumbName.jpg
 * with a height of 300 and a proportional width.
 */
$img->create(300, "thumbsFolder", "thumbName.jpg", Thumb::HEIGHT);

/** 
 * The following will create thumbsFolder/image.jpg
 * with a height of 300 and a proportional width.
 */
$img->create(300, "thumbsFolder", null, Thumb::HEIGHT);

2. Image types

The lib only supports jpg, gif and png files.

3. Bugs and dubts

Any doubts just send me an email at ftestolin(at)gmail.com

About

Mini library for creating thumbs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages