allow file extensions uppercase

This commit is contained in:
John Alanbrook 2023-04-15 21:33:15 +00:00
parent e7a426994b
commit 06667852d1

View file

@ -219,7 +219,7 @@ function sub_ext($src, $ext) {
* jpeg, webp, and avif for lossy, and png and lossless webp for lossless * jpeg, webp, and avif for lossy, and png and lossless webp for lossless
*/ */
function gen_images($src, $opts = "", $lossy=0) { function gen_images($src, $opts = "", $lossy=0) {
$ext = substr($src, strrpos($src, '.')+1); $ext = strtolower(substr($src, strrpos($src, '.')+1));
$psrc = ltrim($src, '/'); $psrc = ltrim($src, '/');
if ($lossy || in_array($ext, ["jpg", "jpeg"])) { if ($lossy || in_array($ext, ["jpg", "jpeg"])) {