diff options
author | plegall <plg@piwigo.org> | 2015-12-16 18:16:16 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-16 18:16:16 +0100 |
commit | ca238de66d4b6801c4cd817c27effcf18a211da2 (patch) | |
tree | 3a485e4f8dce5b28726fcc59ed0f774198c42dbd /admin/site_reader_local.php | |
parent | c3b748ecbfd1a359f6e95e7fd691ac5c11c3c4de (diff) |
feature #379 multiple format, step 3: add/remove
* during sync, Piwigo will detect new/removed formats for an existing photo
* multiple formats features is disabled by default
Diffstat (limited to 'admin/site_reader_local.php')
-rw-r--r-- | admin/site_reader_local.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/admin/site_reader_local.php b/admin/site_reader_local.php index 051e574a6..69f644467 100644 --- a/admin/site_reader_local.php +++ b/admin/site_reader_local.php @@ -101,12 +101,12 @@ function get_elements($path) $representative_ext = $this->get_representative_ext($path, $filename_wo_ext); } - $formats = $this->get_formats($path, $filename_wo_ext); - - $fs[ $path.'/'.$node ] = array( - 'representative_ext' => $representative_ext, - 'formats' => $formats, - ); + $fs[ $path.'/'.$node ] = array('representative_ext' => $representative_ext); + + if ($conf['enable_formats']) + { + $fs[ $path.'/'.$node ]['formats'] = $this->get_formats($path, $filename_wo_ext); + } } } else if (is_dir($path.'/'.$node) @@ -201,13 +201,7 @@ function get_formats($path, $filename_wo_ext) if (is_file($test)) { - // $formats[] = array( - // 'ext' => $ext, - // 'filesize' => floor(filesize($file) / 1024), - // ); - - // we return a "/" splitted string instead of an array with 2 keys, to reduce memory usage - $formats[] = $ext.'/'.floor(filesize($test) / 1024); + $formats[$ext] = floor(filesize($test) / 1024); } } |