Thumbnail Profiles
Hi,
For example when creating an album we can specify the list of ThumbnailProfiles to be used to generate the thumbnails when new image is published in the album. However, my question is - is it possible to programatically get the whole list of ThumbnailProfiles ?
Hi Tomasz,
You can get the Thumbnail profiles for an specific album through the ThumbnailsProfile property of the album. E.g:
LibrariesManager manager = LibrariesManager.GetManager();
var thumbnailProfiles = manager.GetAlbums().Where(a => a.Title ==
"MyAlbum"
).First().ThumbnailProfiles;
Hi Junior,
Thanks for your reply. The code included by you is valid but my question referred to the programmatically getting the list of thumbnail profiles present in the Sitefinity's system to be then used when creating the album. So first I want to obtain a list of thumbnail profiles present in the system (all) , then specify which thumbnail profiles will go for the given album during it's creation. Is that possible at all ?
Hi Tomasz,
In that case you can read all the thumbnail profiles from the configurations. e.g:
var manager = ConfigManager.GetManager();
var config = manager.GetSection<LibrariesConfig>();
var thumbnails = config.Images.Thumbnails;
Thank you Junior for your quick response. I will give it a try soon.