示例#1
0
        public ImageInfo GetImageInfo(string imageId)
        {
            var img      = _imageGateway.SelectOne(imageId);
            var fileInfo = new FileInfo(GetImagePathInternal(imageId, null));
            var size     = fileInfo.Length;
            var res      = new ImageInfo()
            {
                ImageId      = imageId,
                AlbumCount   = _imageInAlbumGateway.SelectByImage(imageId).Count,
                CreationDate = img.CreationDate,
                Size         = size
            };

            return(res);
        }
示例#2
0
        public void AddImageToAlbum(int albumId, string imageId)
        {
            var title = _imageGateway.SelectOne(imageId).InitialFilename;

            _imageInAlbumGateway.Insert(new ImageInAlbum()
            {
                AlbumId = albumId,
                ImageId = imageId,
                Title   = title
            });
            var dataAlbum = _albumGateway.SelectOne(albumId);

            if (!string.IsNullOrEmpty(dataAlbum.WatermarkImageId))
            {
                _imageService.ApplyWatermark(imageId, dataAlbum.WatermarkImageId);
            }
        }