Creating thumbnail images in PHP

Wasn’t easy to find a working solution, so I’m posting here as a reminder.

This is a PHP function to generate images thumbnails that handles: png, jpg, gif and also transparency

I’m not the author of this function, I’ve just mixed two solutions together, and fixed some small issues.

Sources :

http://davidwalsh.name/create-image-thumbnail-php

http://stackoverflow.com/questions/2611852/imagecreatefrompng-makes-a-black-background-instead-of-transparent

Leave a Reply

Your email address will not be published. Required fields are marked *