示例#1
0
        private ImageInfo GetImageInfo(string imageUrl, Size targetSize)
        {
            var crop = _imageProcessor.GetCrop(imageUrl);

            if (crop != null)
            {
                return(new ImageInfo
                {
                    Title = crop.Title,
                    Description = crop.Description,
                    ImageUrl = GetCropImageUrl(crop, targetSize)
                });
            }
            MediaFile image = _imageProcessor.GetImage(imageUrl);

            if (image != null)
            {
                return(new ImageInfo
                {
                    Title = image.Title,
                    Description = image.Description,
                    ImageUrl = GetFileImageUrl(image, targetSize)
                });
            }
            return(null);
        }