Hello,
I would like to use Piwigo to manage some SVG files. According to the release notes at https://piwigo.org/release-13.0.0#svg SVG is natively supported, however after installing the latest stable version (13.6.0 at the time of this writing) and creating a test album, there was no ability to upload svg files to the album.
I tried editing the config file and added svg to the $conf['picture_ext'] array, which allows me to select SVG files to upload, but when I upload them using the [Start Upload] button, it acts like they were uploaded (green checkboxes next to each file and everything) but nothing actually gets uploaded. No errors displayed either. The album shows empty. Other images such as JPG and PNG, however, work fine.
I cannot find any documentation on enabling SVG support in this new version. Did I miss something? Can someone provide instructions on how to truly enable SVG support for my gallery? I'm sure there must be others encountering this issue. Thanks in advance!
Here are my environment details:
Piwigo 13.6.0 Check for upgrade
Installed on 6 March 2023, 2 hours ago
Operating system: Linux
PHP: 8.1.16 (Show info) [2023-03-06 21:46:55]
MySQL: 10.6.12-MariaDB-0ubuntu0.22.04.1 [2023-03-06 21:46:55]
Graphics Library: ImageMagick 6.9.11-60
Cache size 9.64 MB right now Refresh
Offline
djtech wrote:
I tried editing the config file and added svg to the $conf['picture_ext'] array
That sounds like you override the values in your local config. The original include/config_default.inc.php has the svg extension in $conf['file_ext'], not $conf['picture_ext'], might make a difference:
// picture_ext : file extensions for picture file, must be a subset of // file_ext $conf['picture_ext'] = array('jpg','jpeg','png','gif'); // file_ext : file extensions (case sensitive) authorized $conf['file_ext'] = array_merge( $conf['picture_ext'], array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf','svg') );
Offline
Hello erAck, Thanks for the reply. Yes, I moved 'svg' from the $conf['file_ext'] array to the $conf['picture_ext'] for testing. This actually allowed me to select the SVG files for upload in the file browser window, but nothing actually gets uploaded when I press the Start Upload button.
When I revert back to the default settings, I cannot even select my SVG files to upload them.
Still not sure what else to try.
Offline
Hello,
We've investigated on your problem and here's what we've found:
In order to activate svg upload add
$conf['upload_form_all_types'] = true;
in your localFiles editor plugin.
This should enable the upload for svg file and it should appear in the format list that you can upload to your piwigo.
If it doesnt add the following to your localFiles editor plugin :
$conf['file_ext'] = array_merge( $conf['picture_ext'], array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf','svg') );
An other issue that we found that might impact the support of svg is the presence of an svg.png file in "/themes/default/icon/mimetypes" that can cause the svg file to not show properly in your gallery and administration.
Offline
Thank you, Matthieulp, for that recommendation. After making the suggested changes, it seems to have worked! There seems to be a delay for viewing as they didn't appear right away, but it did allow me to upload the SVG files. I appreciate your help. I hope this helps anyone else encountering this issue.
Offline