[api] add optional query (int)'substitute' to command dim

The connector can return the URL of the substitute image whose size will fit in that pixel as the value of the key 'url' of the result data when the 'substitute' parameter gives with `dim` command from the client.

Add the following two options on the client side config `commandsOptions.resize` to fixes #2251.

```javascript
// File size (bytes) threshold when using the `dim` command for obtain the image size necessary to start editing
getDimThreshold : 204800,
// File size (bytes) to request to get substitute image (400px) with the `dim` command
dimSubImgSize : 307200
```
This commit is contained in:
nao-pon
2017-10-30 16:46:19 +09:00
parent 7fa9f62f03
commit 1b6c78820b
12 changed files with 272 additions and 72 deletions
+2 -1
View File
@@ -59,6 +59,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
$this->options['followSymLinks'] = true;
$this->options['detectDirIcon'] = ''; // file name that is detected as a folder icon e.g. '.diricon.png'
$this->options['keepTimestamp'] = array('copy', 'move'); // keep timestamp at inner filesystem allowed 'copy', 'move' and 'upload'
$this->options['substituteImg'] = true; // support substitute image with dim command
}
/*********************************************************************/
@@ -644,7 +645,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
* @author Dmitry (dio) Levashov
**/
protected function _scandir($path) {
elFinder::extendTimeLimit();
elFinder::checkAborted();
$files = array();
$cache = array();
$dirWritable = is_writable($path);