Image Gallery Block add Template Form Submission
Permalink
I'm creating a custom image gallery block with a function using image helper getThumbnail to make automatic thumbnails.
something like this:
I'm not exactly sure how the image helper creates and caches the thumbnails, but I don't want new thumbnails to be created every time the gallery page is loaded.
Instead, under the add template I would like the ability to input a few parameters (width, height) and then a submit button would run the function to create the thumbnails.
Not Exactly sure how to accomplish this.
Any suggestions?
something like this:
$im = Loader::helper('image'); $thumb = $im->getThumbnail($file, $width, $height);
I'm not exactly sure how the image helper creates and caches the thumbnails, but I don't want new thumbnails to be created every time the gallery page is loaded.
Instead, under the add template I would like the ability to input a few parameters (width, height) and then a submit button would run the function to create the thumbnails.
Not Exactly sure how to accomplish this.
Any suggestions?
and on the first request for the thumbnails they are generated, so that initial load is a bit slow, but after that it is fine.
There are thumbnail levels in config defines that set 3 levels of thumbnail widths and heights, I believe there is 1 in there that is user selectable, but I am not sure when those thumbnails are generated, I assume when the file is added to the system.
There are thumbnail levels in config defines that set 3 levels of thumbnail widths and heights, I believe there is 1 in there that is user selectable, but I am not sure when those thumbnails are generated, I assume when the file is added to the system.
Thanks for that info. Would still like to generate them in the add template before saving the block to the page though.
They are created if they don't exist, otherwise they persist in the filesystem for quite a while, and actually from what I understand even though you clear the concrete5 cache these are served by it so they even survive concrete5 cache flushes!. So once you generate them, the cpu cycles are spent and the result is served up like any other static file(because at that point it is one).
-Scott