mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user