CKEditor - CKFinder上传图片后无法自动生成缩略图

3
在使用带有 Ckfinder 的 ckeditor 中,我可以正常上传图像,但在我单击“浏览服务器”按钮之前,它不会创建缩略图,这意味着我必须使用浏览服务器功能手动创建缩略图。
是否有(PHP)的方法可以在上传图像后自动定义创建缩略图?
1个回答

1
最终我已经弄清楚并测试了代码,它可以正常工作。
在ckfinder中找到文件 ckfinder/core/connector/php/php5/CommandHandler/FileUpload.php 查找代码并进行更改。
if($_imagesConfig->getMaxWidth()>0&&$_imagesConfig->getMaxHeight()>0&&$_imagesConfig->getQuality()>0){
    CKFinder_Connector_CommandHandler_Thumbnail::createThumb($sFilePath, $sFilePath, $_imagesConfig->getMaxWidth(), $_imagesConfig->getMaxHeight(), $_imagesConfig->getQuality(), true);
}

if($_imagesConfig->getMaxWidth()>0&&$_imagesConfig->getMaxHeight()>0&&$_imagesConfig->getQuality()>0){
    CKFinder_Connector_CommandHandler_Thumbnail::createThumb($sFilePath, $sFilePath, $_imagesConfig->getMaxWidth(), $_imagesConfig->getMaxHeight(), $_imagesConfig->getQuality(), true);

    $_thumbnails=$_config->getThumbnailsConfig();
    $thumbFilePath=$sServerDir.'_thumbs/Images/'.$sFileName;
    CKFinder_Connector_CommandHandler_Thumbnail::createThumb($sFilePath, $thumbFilePath, $_thumbnails->getMaxWidth(), $_thumbnails->getMaxHeight(), $_thumbnails->getQuality(), true, $_thumbnails->getBmpSupported());
}

每次您完成上传图片后,它将创建缩略图文件。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接