Skip to content

ImageSharp.Web #216

@JimBobSquarePants

Description

@JimBobSquarePants

Description

This issue is designed to capture the architecture and tasks required to build an extensible library for parsing URL API instructions and caching the result.

Feel free to discuss below. We'll assign specific issues for functional components as we determine them.

Basic Requirements

  • Asp.NET Core Middleware to capture valid requests
  • Extensible configuration for Caching, ImageServices, and Processing. Must be secure.
  • IImageService implementations for physical file system and remote images.
  • IDistributedCache implementation for physical file system that can be switched out for Redis, Azure, etc. How do we handle cleanup, Response codes?
  • Fast, low collision hashing of URL for cache implementations.

Pipeline

The following gives an overall summary of the image processing pipeline.

  1. Request is intercepted by Middleware (Authorisation?)
  2. IImageService is assigned using URL prefix pattern matching (Regex?)
  3. IImageService determines validity of request and attempts to return stream containing image.
  4. IDistributedCache implementation checks if file exists. (Redirect if exists?)
  5. Not cached? URL querystring params are parsed for matching processor.
  6. Image is processed by matches via fluent API.
  7. Result is cached and image served.
  8. Cleanup of expired cached files. (How?, When?)

Edit

Updated Requirements and Pipeline below

Basic Requirements

  • Asp.NET Core Middleware to capture valid requests
  • Extensible configuration for Parsing, Resolving, Processing, and Caching. Must be secure
  • Configuration for handling EXIF metadata
  • IUriParser implementation for parsing URI requests for command string that can be switched out
  • IImageResolver implementation collection for physical file system that
  • Extensible CommandParser implementation for converting commands into real values for processing.
  • IImageWebProcessor for Resize
  • IImageWebProcessor for Quality
  • IImageWebProcessor for Format
  • IImageWebProcessor for BackgroundColor
  • IImageCache implementation for physical file system that can be switched out for Azure, etc.
  • Fast, low collision hashing of URL for cache implementations
  • ILogger based logging
  • TagHelper for generating img, picture markup

Pipeline

The following gives an overall summary of the image processing pipeline.

  1. Request is intercepted by Middleware
  2. IUriParser extracts commands; if not found, exit
  3. IImageResolver is assigned using Match() method
  4. IImageResolver determines validity of request and attempts to return stream containing image.
  5. IImageCache implementation checks if file exists. (Returns correct response)
  6. Not cached? URL querystring params are parsed for matching processor.
  7. IImageWebProcessor implementations process the image
  8. Result is cached and image served.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions