Exemplo n.º 1
0
        private string GetThumbnail(GalleryPartItem item, GalleryPartSettings settings)
        {
            if (item.Type == (int)GalleryPartType.LocalImage)
            {
                return($"{_mediaFileStore.MapPathToPublicUrl(item.Url)}?width={settings.ThumbnailSize}&height={settings.ThumbnailSize}&rmode=crop");
            }

            return(item.Url);
        }
Exemplo n.º 2
0
 private GalleryPartItemViewModel[] ShapeMediaItems(GalleryPartSettings settings, GalleryPartItem[] mediaItems, bool isDisplay = true)
 {
     return(mediaItems.Select(x => new GalleryPartItemViewModel
     {
         Thumb = GetThumbnail(x, settings),
         Title = x.Title,
         Type = x.Type,
         TypeName = x.TypeName,
         Url = isDisplay ? GetUrl(x) : x.Url
     }).ToArray());
 }