Skip to content

SergeyFrancev/thumb_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Thumb Image Server

Build Status

Logo

This is simple image thumbnail HTTP server.

He generates image previews or returns existing ones based on the specified parameters in the configuration file.

Example

  • config.toml
base_dir = "/your/path/to/base_directory"
sizes = ["300x200", "100x100"]
  • You have only image.jpg source file
base_directory
└── recipies_image
    └── image.jpg       // Source Image [Any size]
  • After request to YOUR_DOMAIN/recipies_image/300x200/image.jpg
base_directory
└── recipies_image
    ├── 300x200
    |   └── image.jpg   // Image [300x200]
    └── image.jpg       // Source Image [Any size]

Requests return 404

  • incorect size YOUR_DOMAIN/recipies_image/123x321/image.jpg > 404
  • not found image YOUR_DOMAIN/recipies_image/300x200/image2.jpg > 404

Build Relise Version

cargo build -r

Run

  • -c: path to config file [conf.toml]
  • -p: port for listen HTTP request [default:4000]
thumb_server -c ./conf.toml -p 1234

Tests

cargo tests

Benchmark

cargo bench

About

ImgThumb web server on Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages