Like I said, thumbnails are autocreated in TL... using the method in Controller.php:
Code:
protected function addImageToTemplate($objTemplate, $arrItem, $intMaxWidth=false, $strLightboxId=false)
You provide the size, single/multiple (for galleries), floating, imagurl, fullsize, caption, imagemargin, alt, etc. in an array and this method will use the $this-> getImage(filename, width, height, mode) to create the image.
It will generate a thumbnail in the in system/html/ folder, so that its possible to link a file into the IMG tag. If you remove the image, the thumbnail isn't removed, so the file will remain, unless you also clear the cache manually. If in your module you remove the file, you can also optionally remove the cache file yourself, as the cache file will be a unique MD5 name constructed from the image parameters:
Code:
$strCacheName = 'system/html/' . $objFile->filename . '-' . substr(md5('-w' . $width . '-h' . $height . '-' . $image . '-' . $mode), 0, 8) . '.' . $objFile->extension;
So when the NewsList Module wants to display its news Items, it looks to see if you've changed the size of the original image you link to the news item. If you changed the size, it creates a new cache thumbnail (in system/html/) -- something like this:
Code:
campus_building-9306569d.jpg
This image is then the thumbnail version and your source code will link to that instead of the original file in tl_files/, e.g.
Code:
[img]system/html/campus_building-9306569d.jpg[/img]
Bookmarks