core icon indicating copy to clipboard operation
core copied to clipboard

[RFC] Allow thumbnail image extensions to be overridden

Open andysh-uk opened this issue 2 years ago • 0 comments

I’ve been working on a client project to update their 8 year-old Bolt v1.6 site to v5.

Over the years, they have amassed a significant amount of images (tens of thousands.) Most have lower-case extensions (image.jpg) but some have upper-case (e.g. image.JPG).

The latter ones return a 404 from the thumbnail controller action, I believe due to this line:

return array_key_exists('extension', $pathinfo) && in_array($pathinfo['extension'], $imageExtensions, true);

where $imageExtensions only contains lower-cased extensions like “jpg”.

I would like to propose a config option under the existing thumbnails node to allow an array of extensions to be provided that can override the default list.

I’ll implement my proposal in a custom controller in my client’s project for now, and make a relevant PR for the default controller soon.

andysh-uk avatar Mar 28 '22 22:03 andysh-uk