private async Task <Image <Rgba32> > LoadImageAsync(string id, IPhotoStorageService photoStorageService)
 {
     using (var inputStream = await photoStorageService.GetPhoto(id))
     {
         return(Image.Load <Rgba32>(inputStream));
     }
 }
        public ImageProcessingService(CosmosClient client, IOptions <CosmosOptions> options, IPhotoStorageService photoStorageService)
        {
            this.galleriesContainer = client.GetContainer(options.Value.DatabaseId, "galleries");
            this.photosContainer    = client.GetContainer(options.Value.DatabaseId, "photos");

            this.photoStorageService = photoStorageService;
        }
        public GalleryService(CosmosClient client, IOptions <CosmosOptions> options, IPhotoStorageService photoStorageService, NewPhotoNotificiationService newPhotoNotificiationService)
        {
            this.galleriesContainer = client.GetContainer(options.Value.DatabaseId, "galleries");
            this.photosContainer    = client.GetContainer(options.Value.DatabaseId, "photos");

            this.photoStorageService          = photoStorageService;
            this.newPhotoNotificiationService = newPhotoNotificiationService;
        }
Example #4
0
 public PhotoService(
     IDeletableEntityRepository <Photo> photoRespository,
     IPhotoStorageService photoStorageService,
     IPhotoMetadataService photoMetadataService,
     IRepository <PhotoAlbum> photoAlbumRepository)
 {
     this.photoRespository     = photoRespository;
     this.photoStorageService  = photoStorageService;
     this.photoMetadataService = photoMetadataService;
     this.photoAlbumRepository = photoAlbumRepository;
 }
 private async Task SaveImageAsync(IPhotoStorageService photoStorageService, Photo unprocessedPhoto, Image <Rgba32> image)
 {
     using (var ms = new MemoryStream())
     {
         image.Save(ms, new JpegEncoder()
         {
             Quality = 95
         });
         ms.Position = 0;
         await photoStorageService.StorePhoto(unprocessedPhoto.Id, ms);
     }
 }
 public PhotoPresenter(IPhotoStorageService photoStorageService)
 {
     this.photoStorageService = photoStorageService;
 }