﻿using System.IO;
using Vstack.Common.Extensions;

namespace Vstack.Externals.Imaging.General
{
    public class BaseImageService
    {
        private readonly IImageUploader imageUploader;

        private readonly IImageResizer imageResizer;

        public BaseImageService(IImageUploader imageUploader, IImageResizer imageResizer)
        {
            this.imageUploader = imageUploader;
            this.imageResizer = imageResizer;
        }

        public ImageUploadBuilder Upload(Stream imageStream, string path, string container)
        {
            imageStream.ValidateNotNull();
            return new ImageUploadBuilder(imageStream, container, path, this.imageUploader, this.imageResizer);
        }
    }
}
