views:

37

answers:

3

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

+1  A: 

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

Haim Evgi
This would be ideal if the crop function wasn't backwards. Essentially I'd have to get the file size then do the math manually of how much to crop off.
azz0r
+1  A: 

There's a php library for image manipulation called GD - http://php.net/manual/en/book.image.php You could give it a look

adivasile
A: 

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.

sombe
Thats a really nice script, it wouldn't write though and seems pretty hard routed to use the cache route which I can't use.
azz0r