开发者

Are there any open source PHP classes to resize an image to a certain width and height? [closed]

开发者 https://www.devze.com 2022-12-21 00:49 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号