update thumbnail, allow user to choose output format#3714
update thumbnail, allow user to choose output format#3714
Conversation
|
As a general question - is there a command that would "warm up" thumbnail cache so that even first user can benefit from fast loading image? |
|
There is no command for that yet. This command may generate a lot of thumbnails that will never be displayed on the website. |
… structure, allowing Apache/Nginx to serve them directly without any PHP call
bobvandevijver
left a comment
There was a problem hiding this comment.
I will need more time to definitively check this, but here's already my first findings. I also believe that are changes in this PR that are not necessarily needed to fix the main issue (which is fixing the webserver direct file serving).
| $this->parameters = [ | ||
| 'w' => (isset($raw[0]) && is_numeric($raw[0])) ? (int) $raw[0] : 400, | ||
| 'h' => (isset($raw[1]) && is_numeric($raw[1])) ? (int) $raw[1] : 300, | ||
| 'fit' => $raw[2] ?? $this->config->get('general/thumbnails/default_cropping', 'default'), |
There was a problem hiding this comment.
Why has the usage of this setting been removed?
|
|
||
| $this->parseParameters($paramString); | ||
| $urlFilename = $filename; | ||
| $sourceFilename = $this->parseFormatFromFilename($filename); |
There was a problem hiding this comment.
Direct usage of the filename will cause a regression into a security incident (#3661) we had in the past, namely a path traversal. Paths can only be used after a canonicalize call.
Add output format support to thumbnail URLs
Update thumbnail file path in Twig and filesystem to match image URL structure, allowing Apache/Nginx to serve them directly without any PHP call