Code Monkey home page Code Monkey logo

imop's Introduction

IMOP

IMOP (image optimizer) is a webserver. Think of it as either a static fileserver like nginx, which can resize your images on the fly (and cache them), or a microservice that can resize any url you give it.

Implemented in rust and based on tokio, warp and it's static file handling implementation, all IO operations are asynchronous and suffiently fast (although there are no benchmarks yet). Images are resized with the image crate as blocking tokio tasks.

In short, here is what imop provides:

  • stand alone static file server
  • support for resizing images
  • support for async file compression
  • flexible usage and highly extendable as a library
    • warp filter for async compression based on content type
    • warp filter for image resizing
    • warp handler for resizing any image downloaded over http
cargo run --example basic -- --images ./data --cache ./tmp

Usage a library

You can use

TODO

  • implement streaming cache trait that can stream in and out of the cache

  • implement cache access trait (size, get, put)

  • how to add persistence?

    • none for the memory version
    • for files: filepath in some serde data structure
  • implement the cache

  • implement the cli based production server

    • how to differentiate between static file server and api
  • make the image library generic trait as well

  • split into different examples

  • do the image resize and encoding in a blocking pool

  • restructure the current code in different files as a library

  • add image resizing utility function

  • add generic cache implementation (filesystem and in memory implementations)

  • add examples to find a good api

  • lint with clippy

  • add tests

DONE

  • compress based on mime type and browser capabilites or specific alg
    • good api already
  • resize images based on optimizations

imop's People

Contributors

romnn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.