mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 11:49:56 +03: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:
parent
27389102d1
commit
8e098d502a
10 changed files with 191 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue