2013-06-03 39 views
3

在CKEditor的(與ckfinder)的CKEditor - CKFinder不會創建縮略圖後自動上傳我的圖像

我可以正常上傳圖片,但在此之前我點擊「瀏覽服務器」按鈕,它不會產生縮略圖其中意味着我必須使用瀏覽服務器功能來手動創建縮略圖。

有沒有什麼方法(PHP)來定義在我上傳圖片後自動創建縮略圖?

回答

2

最後我想通了,測試代碼工作正常。

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

然後每次完成上傳圖像時它都會創建拇指文件。