dppx9253 2012-12-10 19:57
浏览 65

使用PHPThumb裁剪图像

PHPThumb doesn't have very clear documentation of how to crop images. I HAVE been trying to crop some images to a ratio of 6.6 : 10 i.e I have images which are 1280 by 854, I don't want the height changed but I want the width reduced so that the ratio comes to 570:854 which is approx 6.6:10 . Then it will be resized normally to about 180:270 which maintains the 6.6:10 ratio.

Here's what I've tried, it hasn't been very successful. Its like the images don't even get cropped.

phpThumb.php?src=http://imagedomain.com/image.jpg&sx=0&sy=0&sw=570&sh=854&f=jpg&q=95&h=270&w=";

Could anybody point out what I'm doing wrong?

  • 写回答

2条回答 默认 最新

  • duanhaodi4809 2012-12-10 20:58
    关注

    I'm not familiar with PHPThumb, but if you want a really good tutorial which explains how everything works - http://net.tutsplus.com/tutorials/php/image-resizing-made-easy-with-php/ I base my thumbnail generator code on this combined with: http://us.php.net/manual/en/function.imagecopyresampled.php#77679 + extra stuff to handle transparency.

    评论

报告相同问题?