feature #379 multiple format, step 1: add formats

* new table piwigo_image_format (each photo can have 0 to many formats)
* only compatible with synchronization for now. Formats must be in sub-directory pwg_format
* formats are visible on edition page only for now
This commit is contained in:
plegall 2015-12-03 16:04:02 +01:00
parent 27389102d1
commit 8e098d502a
10 changed files with 191 additions and 0 deletions

View file

@ -952,6 +952,21 @@ function original_to_representative($path, $representative_ext)
return substr_replace($path, $representative_ext, $pos+1);
}
/**
* Transforms an original path to its format
*
* @param string $path
* @param string $format_ext
* @return string
*/
function original_to_format($path, $format_ext)
{
$pos = strrpos($path, '/');
$path = substr_replace($path, 'pwg_format/', $pos+1, 0);
$pos = strrpos($path, '.');
return substr_replace($path, $format_ext, $pos+1);
}
/**
* get the full path of an image
*