No, it’s not yet another PHP thumbnail generation tutorial! I recently needed a function to:
- create square thumbnails
- don’t crop the initial image, but scale it and fill with white background
- center the thumbnail in the square
- call the function in a loop to process an entire folder
I found no suitable example and I decided that instead of digging too much it’s better to create my own function and a class for it.
Let’s start with a photo that we need to create a thumbnail for:

Nice kid, huh?
… and what we want to achieve:

First step would be the thumbnail generation snippet:
Read the rest of this entry »