Are there any open source PHP classes to resize an image to a certain width and height? [closed]
I have one currently that 开发者_运维问答simple does it by aspect ratio, however I need it to fill a 150 x 150 size, whereas mine would honour its ratio and do 150 x 120 for example.
Ideally it would goto the centre of the image.
Thanks
While I think haim's offered link is very good to use, you may want to consider using ImageMagick, which is a multi-language-supported software that I personally believe many hosting companies have. I think it's a more efficient way of implementing what you're looking for, rather than resizing/cropping with GD library.
Take a look at this built function. It also allows caching, and copying remote images to your server.
i recommended about this simple class , you can resize / crop / flip ....
link :
http://www.mawhorter.net/web-development/simple-image-manipulation-in-php-rotate-resize-crop-flip-and-mirror-thumbnails-square-and-regular
There's a php library for image manipulation called GD - http://php.net/manual/en/book.image.php You could give it a look
Try TimThumb, the most popular php class for image resizing
http://code.google.com/p/timthumb/
精彩评论