Reputation: 15250
Given a large image (let's say at least 1200x800px), how can I generate smaller centered square and scaled thumbnails?
I need to generate several thumbnails for this image:
Is there a linux or php library that will help accomplish this?
Sample Image: http://placehold.it/1200x800
Upvotes: 0
Views: 76
Reputation: 69927
Check out PHP Thumbnailer. Simply create one thumbnail for each size you want.
Example Usage:
$thumb = PhpThumbFactory::create('/path/to/image.jpg');
$thumb->resize(100, 100); // resize to 100x100
$thumb->save('/path/to/100x100.jpg');
Simply do that for each size you wish to save.
Check out the docs for more examples.
Upvotes: 1