Hi,
Still new to Piwigo, but I thought I'd share some advice for people wanting to optimise their images for fast delivery/less storage space.
Shortpixel, I use it on wordpress, what I wasn't aware of though is that they have their own standalone script, which is very easy to install and run. You basically upload the folder to your server, then enter a URL which takes you to the screen. Once at this screen you can then browse to a folder on your server where your Piwigo files are kept and it will go through them and optimise.
There's an option to keep backups and there are different options for the compression, lossless, glossy and lossy. Obviously lossy is the one that gives you the most reduction in photo file sizes, but if you choose glossy it's impossible to tell the difference between the two.
There's also an option to generate .webp files (this doesn't count as a credit so effectively free) and I've added an entry in .htaccess to check for these and use if it finds them. Still can't tell if that's working yet or not.
It isn't free, but it is very reasonably priced. 10,000 images for $9.99 for example, or you can pay monthly.
Totally recommend it if you have large galleries, and even if you don't they offer 100 image compressions for free.
This is what I used.
https://shortpixel.com/web-tool-docs
But there are other methods to do things automatically.
Hope this helps people with large galleries.
Offline
This is the .htaccess entry I have for checking to see if there are webp versions of the images and deliver those. As I say, still not sure if it is working, but I'm putting it out there for feedback also.
<IfModule mod_rewrite.c>
RewriteEngine On
# Check if browser supports WebP images
RewriteCond %{HTTP_ACCEPT} image/webp
# Check if WebP replacement image exists
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
# Serve WebP image instead
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=REQUEST_image]
</IfModule>
<IfModule mod_headers.c>
# Vary: Accept for all the requests to jpeg and png
Header append Vary Accept env=REQUEST_image
</IfModule>
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
Offline