![](/img/trans.png)
[英]Ckeditor image upload working, but saying it doesn't (using ckfinder)
[英]CKEditor - CKFinder won't create thumbnail automatically after i upload image
在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());
}
然后每次上傳圖像時都會創建拇指文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.