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
This commit is contained in:
plegall
2015-12-16 18:16:16 +01:00
parent c3b748ecbf
commit ca238de66d
3 changed files with 126 additions and 46 deletions

View File

@@ -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);
}
}