简体   繁体   English

如何在 CKFinder 3 上创建多个缩略图?

[英]How to create multiple thumbnails on CKFinder 3?

I am using CKFinder PHP 3.5.3.我正在使用 CKFinder PHP 3.5.3。

When I upload an image, it creates only one default 150x150 thumbnail currently.当我上传一张图片时,它目前只创建一个默认的 150x150 缩略图。

I tried the following configuration of a thumbnail on the config.php, but it doesn't work:我在 config.php 上尝试了以下缩略图的配置,但它不起作用:

$config['thumbnails'] = array(
    'enabled'      => true,
    'sizes'        => array(
        array('width' => '150', 'height' => '150', 'quality' => 80),
        array('width' => '300', 'height' => '300', 'quality' => 80),
        array('width' => '500', 'height' => '500', 'quality' => 80),
    ),
    'bmpSupported' => true,
);

I would like to create multiple thumbnails such as 150x150, 300x300 and 500x500 when upload an image.我想在上传图片时创建多个缩略图,例如 150x150、300x300 和 500x500。

How can I generate multiple thumbnails when I upload an image?上传图片时如何生成多个缩略图?

In CKFinder 3 thumbnails of different sizes are generated lazily, on demand.在 CKFinder 3 中,不同大小的缩略图会根据需要延迟生成。 This means the thumbnail of a given size will not be generated until requested by CKFinder's frontend.这意味着在 CKFinder 的前端请求之前,不会生成给定大小的缩略图。 It's possible to change this behavior with a plugin.可以使用插件更改此行为。 Here you can find a plugin I have created that enforces CKFinder to generate all the private thumbnails immediately after the file is uploaded. 在这里你可以找到我创建的一个插件,它强制 CKFinder 在文件上传后立即生成所有私有缩略图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM