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.

    评论

报告相同问题?

悬赏问题

  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表