plan2net / webp

Create a WebP copy for images (TYPO3 CMS)
GNU General Public License v3.0
60 stars 34 forks source link

made file-extension case insensitive at delivering as webp #25

Closed the-hotmann closed 4 years ago

the-hotmann commented 4 years ago
  1. Added (?i) befor the extension check as .JPG images would be ignored. (not by generating the webp-files but in delivering them!) (https://www.regular-expressions.info/modifiers.html)
  2. transformed extension check from (png|jpg|jpeg) to (png|jpe?g), same but shorter and valid Regex!

Tested with Apache and working fine, did not test with Nginx but as same changes it should work.

NOTE: without the (?i):

  1. image.JPG will not getting delivered as webp as it is not matching the pattern!
  2. image.jpg will be delivered as webp. I tested this with version 2.1.0

with the (?i):

  1. image.JPG will get delivered as webp!
  2. image.jpg will get delivered as webp!
wazum commented 4 years ago

I added the NC flag for the Apache rewrite to the README, ~* for nginx is already case-insensitive