【问题标题】:CKFinder - Image cutting to specified dimensionsCKFinder - 图像切割到指定尺寸
【发布时间】:2019-04-03 12:34:03
【问题描述】:

当我在 CKFinder 中上传图片时,我希望这张图片是 830x421px。但是由于某种原因,图像没有被切割成这些尺寸。而是自动制作高度或宽度830px421px...所以问题是:我怎样才能让CKFinder将图像切割成那些大小,而不是调整大小...?似乎有某种我无法找到/定位的纵横比?

$config['images'] = array(
    'maxWidth'  => 830,
    'maxHeight' => 421,
    'quality'   => 80,
    'sizes' => array(
        'small'  => array('width' => 182, 'height' => 120, 'quality' => 80),
        'medium' => array('width' => 341, 'height' => 225, 'quality' => 80),
        'large'  => array('width' => 830, 'height' => 421, 'quality' => 80)
    )
);

【问题讨论】:

  • 标题写着'CkFinger',你的意思是CKFinder吗?
  • 是的,很抱歉。

标签: javascript php jquery laravel ckfinder


【解决方案1】:

如果您查看ckfinder\core\connector\php\vendor\cksource\ckfinder\src\CKSource\CKFinder\Image.php,您会看到resize 方法(当然是用于调整图像大小)实际上对calculateAspectRatio 方法进行了硬编码调用(在第549 行附近)。看来您是对的,并且确实存在内部纵横比。不幸的是,我也看不到任何从外部禁用它的方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-23
    • 2013-04-28
    • 1970-01-01
    • 2011-02-23
    • 1970-01-01
    • 1970-01-01
    • 2016-03-17
    • 2015-08-08
    相关资源
    最近更新 更多