I'm working on a website that has many tiled images using JQuery's Masonry plugin. The tiles are all uniform in size, but the images contained within them can be a number of sizes.

I was wondering if there's a good recommendation for a PHP plugin / script that can take an incoming image of any size, and do whatever is required to fit in a certain sized box (have automatically resize, crop, insert black space, etc.)

EDIT:

Thanks for the Php options. is there anything in the JQuery realm too?

有帮助吗?

解决方案

This script would fit your need as well :

http://www.phpcodester.com/2011/01/php-function-to-resize-image-to-fit-in-a-standard-box-without-distortion/

If you need to modify something, php's image functions are always named imagesomething($resource,x,y,etc.)

Hope this helps.

其他提示

You should have a look at TimThumb: http://www.binarymoon.co.uk/projects/timthumb/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top