gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-31 21:36:57 27 4
gpt4 key购买 nike

在 ckeditor 中(使用 ckfinder)

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

有什么方法(PHP)可以定义上传图片后自动创建缩略图吗?

最佳答案

最后我弄明白了并测试了代码工作正常。

在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());
}

然后它会在您每次完成上传图片时创建缩略图文件。

关于php - CKEditor - CKFinder 在我上传图片后不会自动创建缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16890441/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com