CKEditor - 我上传图片后CKFinder不会自动创建缩略图

时间:2013-06-03 05:22:49

标签: php javascript ckeditor ckfinder

在ckeditor(使用ckfinder)

我可以正常上传图片,但在点击“浏览器服务器”按钮之前不会创建缩略图,这意味着我必须使用浏览服务器功能才能手动创建缩略图。

上传图片后,有没有办法(PHP)自动定义创建缩略图?

1 个答案:

答案 0 :(得分:1)

最后我已经弄明白并测试了代码是否正常。

在ckfinder中找到该文件 ckfinder /型芯/连接器/ 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());
}

然后每次完成上传图片时都会创建拇指文件。

相关问题