Exemplo n.º 1
0
 public SystemIoFileStorage(PathResolver pathResolver, IOptions <SystemIoStorageOptions> configuration, ImageFormatDefinition formatDefinition)
 {
     Ensure.NotNull(pathResolver, "pathResolver");
     Ensure.NotNull(configuration, "configuration");
     Ensure.NotNull(formatDefinition, "formatDefinition");
     this.pathResolver     = pathResolver;
     this.configuration    = configuration.Value;
     this.formatDefinition = formatDefinition;
 }
Exemplo n.º 2
0
        public ImagePath(SystemIoFileStorage storage, ImageFormatDefinition formatDefinition, Entry entry, Image image)
        {
            Ensure.NotNull(formatDefinition, "formatDefinition");
            Ensure.NotNull(entry, "entry");
            Ensure.NotNull(image, "image");

            string storagePath = storage.GetStoragePath(entry);
            string baseName    = Path.GetFileNameWithoutExtension(image.FileName);

            Original  = Path.Combine(storagePath, image.FileName);
            Thumbnail = Path.Combine(storagePath, String.Concat(baseName, ".thumbnail", formatDefinition.FileExtension));
            Preview   = Path.Combine(storagePath, String.Concat(baseName, ".preview", formatDefinition.FileExtension));
        }
Exemplo n.º 3
0
 public ImageResizeService(ImageFormatDefinition formatDefinition)
 {
     Ensure.NotNull(formatDefinition, "formatDefinition");
     this.formatDefinition = formatDefinition;
 }