GithubHelp home page GithubHelp logo

kkty / image-server Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 2.0 63 KB

Simple http server that accepts an image, converts it to a different format, resizes/compresses it and sends it back

License: MIT License

Go 98.59% Dockerfile 1.41%

image-server's Introduction

image-server is a simple http server that accepts an image, converts it to a different format, resizes/compresses it and sends it back.

codecov

Run on CloudRun

Run on Google Cloud

Usage

$ docker pull kkty/image-server
$ docker run -d -p 8080:8080 kkty/image-server
$ curl "http://localhost:8080?quality=30&width=100&height=200" \
  -X POST \
  --data-binary '@original.png' \
  -H 'content-type:image/png' \
  -H 'accept:image/jpeg' \
  > compressed.jpg
  • content-type / accept can either be image/png, image/jpeg or image/gif.
  • quality can be an integer value ranging from 1 to 100.
    • It takes effect only when the output is in jpeg format, i.e. accept is set to image/jpeg.
  • width and height set the size of the output image in pixels.
    • If width is set and height is not set, height will be such that the original aspect ratio will be kept, and vice versa.
    • If both of them are not set, the original size will be kept unchanged.

Notes

  • The port 8080 is used as default. To change the port to listen on, set PORT environment variable.

image-server's People

Contributors

kkty avatar

Stargazers

Maxim Grynykha avatar Nikita avatar  avatar  avatar GAURAV avatar Nate Woods avatar micnncim avatar Janina Mejia avatar Salvatore Gentile avatar Adam Curtis avatar  avatar NeoChow avatar  avatar Sunder Rajan avatar Shammi Shailaj avatar John Datserakis avatar Dimitri Koshkin avatar Karnawat Wongudom avatar Erick Mejia Blanco avatar Omar El Halabi avatar Pim Snel avatar Park Sang kil avatar Sandeep Manne avatar Andri Óskarsson avatar identityleak avatar AlexY avatar Thad Smith avatar Devin Pastoor avatar roman sarmiento gomez avatar Atakan Özceviz avatar Kohei Suzuki avatar  avatar

Watchers

Eric Coleman avatar James Cloos avatar  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.