Hi! First off I want to say thanks alot for sharing this nice piece of software :) What I'm wondering is if there is any way to easily create a square thumbnail without canvas, from an image? This meaning the image's shortest side (height or width) is shrunk to desired size, and then the widest side is cropped to the same size -- if that makes sense? I suppose this could be done with some small extra function, but it'd be great if you knew a way to get this done before I start making a mess of everything. Thanks again! :) I'll be happy to credit you. |
|||

Square crop
Hi and Thx!
Any links or credit is of course very much appreciated.
To get a square crop do the following (for 100x100px):
$thumb -> Cropimage = array(2,1,50,50,50,50);
If you need a percentage wise square crop, it's more difficult. You would first need to calculate the percentage for X and Y using Getsize() and then pass the correct scaling factors to the class.
Success!!